我在通过 Homebrew 软件安装 Node 时遇到问题。
$ 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 uninstall 时,出现命令未找到错误。有什么建议吗?
注意:在某个时间点,我卸载了brew 和npm。我认为某些剩余的软件包导致了此错误?
最佳答案
您是否安装了非 Homebrew 版本的 Node ?如果没有,那么即使 npm 在您的路径中,它也可能不会运行,因为它需要 Node 才能运行。
假设您想从 Homebrew 程序重新开始使用 Node,则应该可以安全地删除 /usr/local/lib/nodemodules/
目录。这应该消除 Homebrew 警告。您可能需要先记下其中安装的所有内容,以便在通过 Homebrew 程序安装 Node 和 npm 后可以重新安装它。
关于node.js - brew安装 Node 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21223168/