2014-01-19 164 views
1

我在通过自制程序安装节点时遇到问题。brew安装节点错误

$ brew install node 

将返回:

node: Beginning with 0.8.0, this recipe now comes with npm. 
It appears you already have npm installed at /usr/local/lib/node_modules/npm. 
To use the npm that comes with this recipe, first uninstall npm with 
`npm uninstall npm -g`, then run this command again. 

If you would like to keep your installation of npm instead of 
using the one provided with homebrew, install the formula with 
the `--without-npm` option. 
Error: An unsatisfied requirement failed this build. 

当我运行NPM卸载我得到未找到错误的命令。有什么建议么?

注意:在某个时间点,我卸载了brew和npm。我在想一些剩余的软件包会导致这个错误?

回答

3

您是否安装了非自制软件的节点版本?如果没有,那么即使npm在你的路径中,它可能也不会运行,因为它需要节点才能运行。

假设您想从自制软件开始重新使用节点,您应该可以安全地删除/usr/local/lib/nodemodules/目录。这应该摆脱自制警告。您可能首先要记下安装的任何东西,以便在通过自制程序安装node和npm之后重新安装它。

+0

非常感谢你! – djfdev

+0

我试过'rm -r/usr/local/lib/nodemodules /',并得到这个错误:'rm:/ usr/local/lib/nodemodules /:没有这样的文件或目录' – JGallardo

+0

@JGallardo你是否得到了完全相同的在OP中出现错误,还是显示了不同的路径?如果显示了不同的路径,您是否尝试删除该目录? – Andy

0

我倾向于相信您已经安装节点BOT没有映射节点到系统PATH变量,检查,如果是先卸载地图旧的安装,你应该确定