【发布时间】:2021-12-29 20:24:02
【问题描述】:
我在本地机器上升级了节点,并从create-react-app 迁移到nextjs。
当我将代码推送到 AWS Amplify 时,出现以下错误:
error game-night@0.1.0: The engine "node" is incompatible with this module. Expected version ">=12.22.0". Got "12.21.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
我查看了 stackoveflow 和其他博客,并且尝试了所有方法,但仍然出现此错误。
我的试验:
- 添加引擎:节点到我的 package.json
"engines": {
"node": ">=12.22.0"
}
- 运行这些命令:
sudo npm cache clean -f
sudo npm install -g n
- 仔细检查了我的节点版本:
node -v
v16.13.0
- 使用 yarn install 删除并安装 node modules 文件夹
为什么还会出现这个错误?
【问题讨论】:
标签: node.js amazon-web-services next.js amplify