我已经使用brew install node
安装了node,当我使用node -v
时,我会得到以下v5.0.0
。但是,当我尝试运行npm
命令时,我得到了npm: command not found
。
我试着运行brew install npm
,但是我得到了如下的响应node-5.0.0 already installed
。
它发生在节点也返回未找到的命令,但我通过运行brew link node
修复了它,但是npm似乎仍然不工作。
如何解决此问题?
发布于 2015-11-07 05:40:11
尝试运行
$ brew postinstall node
发布于 2016-04-15 02:42:47
我遇到了同样的问题。在网上搜索和阅读了不同的东西后,对我起作用的是:
$ brew postinstall node
但是,首先请执行:
$ brew doctor
然后先按照说明进行操作,就像你问题中提到的注释一样。
发布于 2017-06-05 00:46:01
尝试以下操作:
$ brew update
$ brew uninstall node
$ brew install node
$ sudo chown -R YouComputerName /usr/local/lib/node_modules/
$ brew postinstall node
https://stackoverflow.com/questions/33575082
复制相似问题