【发布时间】:2019-07-25 17:01:35
【问题描述】:
我试图在我的项目中运行yarn 命令,但它失败了,报告了不兼容的节点版本。
奇怪的是,我的 node 版本是 12.7.0,而不是 Yarn` 报告的 13.0.0-nightly2019072543e5478e2f。
发生了什么事?
注意:我使用的是 Ubuntu 18.04 LTS,它的 Node 版本已经过时,但我使用 NVM 将其更新到了 12.7.0。
命令输出
$ yarn
yarn install v1.17.3
warning You are using Node "13.0.0-nightly2019072543e5478e2f" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
error xmlbuilder@9.0.7: The engine "node" is incompatible with this module. Expected version ">=4.0". Got "13.0.0-nightly2019072543e5478e2f"
error Found incompatible module.
$ node --version
v12.7.0
$ nvm list
v12.6.0
-> v12.7.0
system
default -> node (-> v12.7.0)
node -> stable (-> v12.7.0) (default)
stable -> 12.7 (-> v12.7.0) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/dubnium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.16.0 (-> N/A)
lts/dubnium -> v10.16.0 (-> N/A)
【问题讨论】:
-
您是否尝试重新安装节点?
-
@GProst:我尝试使用 NVM 和 Ubuntu 的包管理器重新安装两者。没有帮助。
标签: node.js ubuntu yarnpkg ubuntu-18.04