【问题标题】:How to fix this npm error trying to update如何修复此 npm 错误尝试更新
【发布时间】:2022-01-16 02:23:50
【问题描述】:
leolemus@Leos-MBP-2 ~ % npm install -g npm@latest
npm does not support Node.js v15.11.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@8.3.0
npm ERR! notsup Not compatible with your version of node/npm: npm@8.3.0
npm ERR! notsup Required: {"node":"^12.13.0 || ^14.15.0 || >=16"}
npm ERR! notsup Actual:   {"npm":"8.3.0","node":"v15.11.0"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/leolemus/.npm/_logs/2021-12-12T02_35_45_442Z-debug-0.log

我使用 macOS 11.2.2 并且我通过自制软件安装了节点。当我执行“brew upgrade node”时,它说它是最新的。

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: node.js npm webpack


【解决方案1】:

您可以随时查看您使用的是哪个版本:

node --version

如果你没有使用你安装的节点,你可以取消链接你不想要的版本

brew unlink node

安装你想要的node版本:

brew install node@version

然后链接到它:

brew link node@version

验证您正在使用它:

node --version

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-20
    • 2017-07-11
    • 2019-09-01
    • 2020-03-26
    • 2014-08-15
    • 1970-01-01
    • 2023-02-07
    • 2021-04-23
    相关资源
    最近更新 更多