【问题标题】:npm install vercel fails for wrong node version though it is correctnpm install vercel 因错误的节点版本而失败,尽管它是正确的
【发布时间】:2020-11-14 19:13:56
【问题描述】:

我正在尝试安装 Vercel 包:

$ sudo npm i -g vercel

> vercel@19.2.0 preinstall /usr/local/lib/node_modules/vercel
> node ./scripts/preinstall.js

> Error! Detected unsupported Node.js version.
Expected ">= 10" but found "8.10.0".
Please update to the latest Node.js LTS version to install Vercel CLI.
npm WARN notsup Unsupported engine for vercel@19.2.0: wanted: {"node":">= 10"} (current: {"node":"8.10.0","npm":"6.14.6"})
npm WARN notsup Not compatible with your version of node/npm: vercel@19.2.0

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vercel@19.2.0 preinstall: `node ./scripts/preinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the vercel@19.2.0 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

它声称我的节点版本不高于 v10,但是当我执行以下操作时,它显示:

 $ node -v
v12.18.2

和 npm:

 $ npm -v
6.14.6

那么,谁在撒谎? ;) 有什么问题?

【问题讨论】:

    标签: npm next.js vercel


    【解决方案1】:

    我建议您使用nvm list 检查该版本是否为默认版本。

    有关设置默认版本的更多信息,请查看this question

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-05
      • 1970-01-01
      • 2020-09-22
      • 1970-01-01
      • 1970-01-01
      • 2014-10-24
      • 1970-01-01
      • 2020-06-04
      相关资源
      最近更新 更多