我用 brew 'brew install node' 安装了 node,我收到一条警告消息
'Warning: The post-install step did not complete successfully'.
当我输入 node -v 时,我确实可以看到 node 的当前版本,但是当我尝试查找 npm 的当前版本时,我得到了这个错误。
-bash: /usr/local/bin/npm: No such file or directory
NPM 不存在的原因是安装后步骤没有成功完成吗?
最佳答案
是的,那件事也发生在我身上。经过大量搜索后,我找到了解决方案。我认为这会对您有所帮助。
sudo brew uninstall node
brew update
brew upgrade
brew cleanup
brew install node
sudo chown -R myusername /usr/local
brew link --overwrite node
sudo brew postinstall node
谢谢!!
关于node.js - 已安装 Node ,但未安装 NPM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36972887/