I am running sudo npm install -g @angular/cli, and I am running in to a bunch of errors.
The latest one is this:
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm ERR! code 2
npm ERR! git dep preparation failed
npm ERR! command /opt/homebrew/Cellar/node/20.0.0/bin/node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js install --force --cache=~/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 2
npm ERR! npm ERR! path ~/.npm/_cacache/tmp/git-clonecrQU0L
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c npm run compile
npm ERR! npm ERR! > [email protected] precompile
npm ERR! npm ERR! > rimraf build
npm ERR! npm ERR!
npm ERR! npm ERR!
npm ERR! npm ERR! > [email protected] compile
npm ERR! npm ERR! > tsc
npm ERR! npm ERR!
npm ERR! npm ERR! error TS5083: Cannot read file '~/.npm/_cacache/tmp/git-clonecrQU0L/node_modules/gts/tsconfig-google.json'.
npm ERR! npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in: ~/.npm/_logs/2023-05-01T22_18_21_178Z-debug-0.log
npm ERR! A complete log of this run can be found in: ~/.npm/_logs/2023-05-01T22_18_10_638Z-debug-0.log
How do I fix this and successfully install angular CLI on my Mac?
I too was getting this error yesterday. I spent a bit of time struggling to find out why. However, it seems to be transient issue, I was able to do a basic npm install -g @angular/cli today without any problems.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With