简体   繁体   中英

NextJS Netlify build failing with node version “12.18.3”

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 my-app-name@0.1.0: 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM