Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to my deploy a small blog built with NextJS on Netlify but I'm getting this error while generating a build:

10:59:39 PM: [1/5] Validating package.json...
10:59:39 PM: error [email protected]: The engine "node" is incompatible with this module. Expected version "12.18.3". Got "12.18.0"
10:59:39 PM: error Found incompatible module.

My package.json has dependencies and engines specified like this:

 "dependencies": {
    "autoprefixer": "^10.0.4",
    "next": "^10.0.0",
    "postcss": "^8.1.10",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "tailwindcss": "^2.0.1"
  },
"engines": {
    "node": "12.18.3"
  }

However, if I change my node version in package.json to 12.18.0 it seems to generate the build on netlify successfully, but in that case my local dev server has trouble starting.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
859 views
Welcome To Ask or Share your Answers For Others

1 Answer

I solved this with yarn config set ignore-engines true and then delete node-modules and reinstall. But its a hack.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...