I've been attempting to update my npm globally using the npm install -g npm
command in Git Bash to keep it current with Angular 11 and Node.js version 15.5.0. I receive the following error:
npm ERR! code EEXIST
npm ERR! path C:Program Files
odejs
pm.cmd
npm ERR! Refusing to delete C:Program Files
odejs
pm.cmd: is outside C:Program Files
odejs
ode_modules
pm and not a link
npm ERR! File exists: C:Program Files
odejs
pm.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
I deleted the file from nodejs
and attempted to install again, but received another error about the npx.cmd
. I deleted that file, attempt installation, and received an error about the npm file.
npm ERR! code EEXIST
npm ERR! path C:Program Files
odejs
px.cmd
npm ERR! Refusing to delete C:Program Files
odejs
px.cmd: is outside C:Program Files
odejs
ode_modules
pm and not a link
npm ERR! File exists: C:Program Files
odejs
px.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! code EEXIST
npm ERR! path C:Program Files
odejs
pm
npm ERR! Refusing to delete C:Program Files
odejs
pm: is outside C:Program Files
odejs
ode_modules
pm and not a link
npm ERR! File exists: C:Program Files
odejs
pm
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
After deleting them and attempting to install npm
again, Git Bash no longer finds npm. The installation never starts.
bash: /c/Program Files/nodejs/npm: No such file or directory
I tried to delete the npm file from my roaming folder in AppData
, but received the following error:
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:UsersYoga 2 MitchellAppDataRoaming
pm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:UsersYoga 2 MitchellAppDataRoaming
pm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
I've also tried the following at different times:
- Delete
node_modules
and reinstall npm
- Used npm 7.3.0's Git repository to create a new
npm
file (?) (I will need to find the suggestion online again to clarify/provide more specifics)
- Clean caches
- Uninstall and reinstall Angular 11 CLI and Node.js (tried for both LTS and Current version)
Nothing has worked so far. The second method I tried in the above list was able to update it to 6.14.10, but this attempt returned errors that seemed to affect Angular. I reverted everything to the original state to be safe. Please let me know if I can clarify anything else regarding my issue.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…