Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js brew安装节点错误_Node.js_Homebrew - Fatal编程技术网

Node.js brew安装节点错误

Node.js brew安装节点错误,node.js,homebrew,Node.js,Homebrew,通过自制程序安装节点时遇到问题 $ 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 `n

通过自制程序安装节点时遇到问题

$ 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。我想是某个遗留软件包导致了此错误?

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


假设您想从自制的node重新开始,那么删除
/usr/local/lib/nodemodules/
目录应该是安全的。这将消除自制的警告。您可能需要先记录安装在那里的任何内容,以便在通过自制程序安装node和npm后重新安装。

我倾向于认为您安装的node bot没有将node映射到系统路径变量,请检查,如果是这样,首先卸载map您的旧安装,您应该可以

我尝试了
rm-r/usr/local/lib/nodemodules/
,得到了这个错误:
rm:/usr/local/lib/nodemodules/:没有这样的文件或目录
@JGallardo您得到了与OP中完全相同的错误,还是显示了不同的路径?如果显示了不同的路径,是否尝试删除该目录?
$ brew install node