node.js - brew安装 Node 错误

标签 node.js homebrew

我在通过 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/

相关文章:

javascript - Appium Node 示例测试未运行

python - 在 Mac OS X Yosemite 上安装 Python3

python - pip install pkg 给出权限被拒绝 :/Library/Python/2. 7/site-packages/pkg

python - 在 os x 上使用 python3 安装 pyside

node.js - 用于 Nodejs 的简单 aws-sdk 不起作用

node.js - 如何用 Jest 模拟 AWS Cognito CognitoIdentityServiceProvider?

javascript - DialogFlow 中的 fulfillmentText 与 fulfillmentMessages

node.js - Nodejs检查是否已经过了XX时间

perl - 操作系统更新后,big sur 上的 mytop 停止工作

Python( Homebrew 程序)在 Sqlite 上返回错误