【问题标题】:Error during migration from npm to yarn - The engine "node" is incompatible with this module从 npm 迁移到 yarn 时出错 - 引擎“节点”与此模块不兼容
【发布时间】:2021-07-10 06:57:30
【问题描述】:

在我的项目中,我正在尝试将 从 npm 迁移到 yarn

我只是运行“yarn”命令来生成“yarn.lock”。

在此过程中,它向我显示以下错误:

error linearicons@1.0.2:引擎“节点”与此模块不兼容。

预期版本“^12.13.0”。出现“10.19.0”错误发现不兼容的模块。

所以我运行命令“npm remove linearicons”然后“yarn”生成“yarn.lock”没有错误,然后“纱线添加线性图标”。但它给了我与上面相同的错误。

我的 Yarn 版本是 1.22.10

节点版本:v10.19.0

我能做些什么来解决这个问题?我不明白他想要什么

【问题讨论】:

  • 将你的node.js版本从10.19.0更新为>=12.13.0
  • 是的,谢谢它有效

标签: node.js npm migration yarnpkg


【解决方案1】:

更新 node.js 版本:

安装nvm

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
$ source ~/.bashrc

寻找 node.js 的现有版本

$ nvm ls-remote

安装最后一个(截至今天)

$ nvm install v16.8.0

之后您的问题应该得到解决。

【讨论】:

    【解决方案2】:
    yarn install --ignore-engines
    

    这对我有用,它显示了这个错误:

     webpack-dev-server@4.5.0: The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "10.19.0"
    

    --ignore-engines 之后的最终结果

    success Saved lockfile.
    

    【讨论】:

      猜你喜欢
      • 2019-10-30
      • 2020-11-17
      • 2021-03-22
      • 2020-01-03
      • 2020-02-02
      • 2021-11-26
      • 1970-01-01
      • 2021-11-19
      相关资源
      最近更新 更多