以下是问题描述:
error gatsby@3.6.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0". Got "10.24.1"
这里是仓库和部署日志的链接:
https://github.com/simonxcode/simonxcode.com https://app.netlify.com/sites/simonxcode/deploys/60aeec1c22d2e5154232e488
我知道这个问题之前被问过很多次,但是常见的解决方案都对我没用。也许我执行它们时有误或者漏了其他什么东西。以下是我尝试过的解决方案:
execute
yarn --ignore-engines
from How to ignore incompatible engine "node" error on installing npm dependencies with yarn?set node variable in
.env
file (not visible in repo because.gitignore
) from Setting Environment Variables for Node to retrieve//.env file NODE_ENV=development
add
"engine": { "node": ">=12.13.0"}
topackage.json
from The engine "node" is incompatible with this moduleUpdate node with
brew update
andbrew upgrade node
from The engine "node" is incompatible with this moduleNote 1: Before updating Homebrew, I deleted
node_modules/
andyarn.lock
filesNote 2: after executing
brew postinstall node
andbrew link --overwrite node
, I no longer have access to node, yarn or gatsby when checking withnode -v
,yarn -v
andgatsby -v