yarn install报错The engine "node" is incompatible with this module

吴宇 2020-05-23 30℃ 0条

yarn install报错The engine "node" is incompatible with this module.可通过键配置中的ignore-engines设置为true来解决

       yarn install时出现跑错:

error chalk@4.0.0: The engine "node" is incompatible with this module. Expected version ">=10". Got "8.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

       看这个报错提示,是因为node版本不匹配。这时候只需要将yarn的配置中的ignore-engines设置为true即可。

root@wuyu_ubuntu:/var/www/xhserp# yarn config set ignore-engines true
yarn config v1.19.1
success Set "ignore-engines" to "true".
Done in 0.09s.

       这时候我们用yarn config list即可看到ignore-engines配置项的值已改为true

root@wuyu_ubuntu:/var/www/xhserp# yarn config list
yarn config v1.19.1
info yarn config
{ 'version-tag-prefix': 'v',
  'version-git-tag': true,
  'version-commit-hooks': true,
  'version-git-sign': false,
  'version-git-message': 'v%s',
  'init-version': '1.0.0',
  'init-license': 'MIT',
  'save-prefix': '^',
  'bin-links': false,
  'ignore-scripts': false,
  'ignore-optional': false,
  registry: 'http://registry.npm.taobao.org/',
  'strict-ssl': true,
  'user-agent': 'yarn/1.19.1 npm/? node/v8.10.0 linux x64',
  'ignore-engines': true,
  lastUpdateCheck: 1590147780562 }
info npm config
{ 'unsafe-perm': true,
  proxy: null }
Done in 0.09s.

标签: 虚拟机

非特殊说明,本博所有文章均为博主原创。