安装一个组件库总是报错:
E:\study\demo> yarn add
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
warning url-loader@1.1.2: Invalid bin field for "url-loader".
error commander@9.0.0: The engine "node" is incompatible with this module. Expected version "^12.20.0 || >=14". Got "12.13.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
手动右键删除 node_modules
文件夹,清空了 npm
缓存:
npm cache clean --force
发现还是不行。
后来在网上找到了解决方案:忽略错误。
终端输入命令:文章来源:https://www.toymoban.com/news/detail-520684.html
yarn config set ignore-engines true
再重新安装依赖,运行项目就可以了:
文章来源地址https://www.toymoban.com/news/detail-520684.html
到了这里,关于The engine “node“ is incompatible with this module. Expected version 问题解决办法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!