在部署到AWS时,我得到了以下纱线错误
error fs-extra@7.0.1: The engine "node" is incompatible with this module. Expected version ">=6 <7 || >=8". Got "7.0.0"
你知道怎么解决吗?
如果我在package.json中指定引擎,这将奏效吗
{
"engines" : {
"node" : ">=8.0.0"
}
}
在部署到AWS时,我得到了以下纱线错误
error fs-extra@7.0.1: The engine "node" is incompatible with this module. Expected version ">=6 <7 || >=8". Got "7.0.0"
你知道怎么解决吗?
如果我在package.json中指定引擎,这将奏效吗
{
"engines" : {
"node" : ">=8.0.0"
}
}
当前回答
在安装包时,像这样在后缀中添加——ignore-engines:
Yarn add <package_name>——ignore-engines
其他回答
您需要运行以下命令,您的问题将得到解决
yarn install --ignore-engines
or
npm install --ignore-engines
在安装包时,像这样在后缀中添加——ignore-engines:
Yarn add <package_name>——ignore-engines
将Node.js更新到最新版本。
https://nodejs.org/en/download/
我不建议使用这个:
% yarn install --ignore-engines
它回避问题,而不是解决问题。 一个可能的解决方案是将节点更新到> 8.0版本。
% brew upgrade node
或者您可以尝试使用nodenv安装多个版本的node,以防其他项目需要它们。
% brew install nodenv
% nodenv init
# Load nodenv automatically by appending
# the following to ~/.zshrc:
eval "$(nodenv init -)"
% nodenv install 6.0.0 //or some other version
我的问题用yarn—ignore-engines解决了,但我不知道为什么以及如何解决。