我有这个问题:
$ npm install -g @angular/cli
-bash: /usr/local/bin/npm: No such file or directory
当我按照建议运行brew reinstall node
时,其结尾为:
==> Summary
? /usr/local/Cellar/node/12.10.0: 4,590 files, 53.4MB
==> `brew cleanup` has not been run in 30 days, running now...
Error: Permission denied @ unlink_internal - /usr/local/lib/node_modules/expo-cli/node_modules/.bin/detect-libc
看来我应该在v12.1.10
但是:
$ node -v
v11.12.0
$ npm -v
-bash: npm: command not found
这是我的路,如果有帮助的话。
// ♥ echo $PATH
/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/TuzMacbookPro2017/Library/Android/sdk/platform-tools::/Users/TuzMacbookPro2017/.rvm/gems/ruby-2.3.7/bin:/Users/TuzMacbookPro2017/.rvm/gems/ruby-2.3.7@global/bin:/Users/TuzMacbookPro2017/.rvm/rubies/ruby-2.3.7/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/TuzMacbookPro2017/Library/Android/sdk/platform-tools::/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/TuzMacbookPro2017/.npm-global/bin:/Users/TuzMacbookPro2017/.rvm/bin:/Users/TuzMacbookPro2017/.npm-global/bin:/usr/local/bin
[14:24:05] ~
此外,类似地:在yarn global add @angular/cli
之后
success Installed "@angular/cli@8.3.5" with binaries:
- ng
✨ Done in 86.81s.
$ ng -v
-bash: ng: command not found