角度从 8 升级到 9 - 纱线不兼容错误

Posted

技术标签:

【中文标题】角度从 8 升级到 9 - 纱线不兼容错误【英文标题】:Angular upgrade from 8 to 9 - yarn incompatible error 【发布时间】:2020-08-15 05:53:24 【问题描述】:

我已根据 angular.io 升级指南将项目从 8 升级到 9 但是 升级 yarn install 后出现此错误。有谁知道如何解决这个问题?

错误:

错误@angular-devkit/build-angular@0.901.4:引擎“yarn”与此模块不兼容。预期版本 ">= 1.13.0"。 错误发现不兼容的模块。

纱线安装

warning @angular-devkit/build-angular > webpack-dev-server > chokidar > fsevents@1.2.12: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @angular-devkit/build-angular > webpack > watchpack > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning @angular-devkit/build-angular > stylus > css-parse > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @angular-devkit/build-angular > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @angular-devkit/build-angular > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @angular/cli > universal-analytics > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning karma > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning karma > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning karma > log4js > circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
[2/4] ????  Fetching packages...
error @angular-devkit/build-angular@0.901.4: The engine "yarn" is incompatible with this module. Expected version ">= 1.13.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

【问题讨论】:

【参考方案1】:

确保你有一个稳定版本的 yarn https://classic.yarnpkg.com/en/docs/install/#windows-stable

我已经安装了 yarn 1.22.4 并且它工作了

【讨论】:

以上是关于角度从 8 升级到 9 - 纱线不兼容错误的主要内容,如果未能解决你的问题,请参考以下文章

引擎“节点”与此模块不兼容

升级到mysql8.0后部分SQL语句出现group by不兼容问题

即使安装后也无法运行任何纱线 cmd

将 Grails 应用程序从 1.3.7 升级到 Java 8 兼容版本

Python 版本不匹配:模块是为 Python 3.6 编译的,但解释器版本不兼容:3.9.8

解决从idea2019升级到idea2020以后,插件不兼容问题