Following error occurred when trying to install:
npm install -g @angular/cli
npm ERR! code EEXIST
npm ERR! syscall rename
npm ERR! path /Users/user/.npm/_cacache/tmp/a28abb5a
npm ERR! dest /Users/user/.npm/_cacache/content-v2/sha512/49/6a/4875bf54e614bb063b54bc15d4e14abeb661019ad0d79239ca8d72381b4912fc3be9b884e96ecc36cecd20c048d0cee9af66aa3cfbbc1f39504ed51fc3e7
npm ERR! errno EEXIST
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/ip-address: EACCES: permission denied, rename '/Users/user/.npm/_cacache/tmp/a28abb5a' -> '/Users/user/.npm/_cacache/content-v2/sha512/49/6a/4875bf54e614bb063b54bc15d4e14abeb661019ad0d79239ca8d72381b4912fc3be9b884e96ecc36cecd20c048d0cee9af66aa3cfbbc1f39504ed51fc3e7'
npm ERR! File exists: /Users/user/.npm/_cacache/content-v2/sha512/49/6a/4875bf54e614bb063b54bc15d4e14abeb661019ad0d79239ca8d72381b4912fc3be9b884e96ecc36cecd20c048d0cee9af66aa3cfbbc1f39504ed51fc3e7
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in: /Users/user/.npm/_logs/2024-09-12T01_45_41_421Z-debug-0.log
What is the issue with npm? How to resolve this error?
The message say
EACCES: permission denied, rename ‘/Users/user/.npm/_cacache/tmp/a28abb5a’
So, it seems a write operation issue with your file that already exist.
Check for npm processes running and shutdown,
you can try clearing your cache data with
npm cache clean –force
Then, run again your command
npm install -g @angular/cli
If the error continues, check for filesystem permissions.
1