Roots Discourse

Error: The engine "node" is incompatible with this module. Sage fails on first “yarn” command

I have this error at the first “yarn” command on a new website.

error autoprefixer@10.2.3: The engine “node” is incompatible with this module. Expected version “^10 || ^12 || >=14”.

I checked the package.json file and I can see

  "engines": {
    "node": ">= 8.0.0"
  },

So I checked my node -v and I can see v8.9.4

so I am confused because my node version is above the requirement.

what I can try to do for this?

I googled and I found out that that running this command yarn install --ignore-engines can avoid that error, but I am wondering if this is a bad call and it will bring more problems in the future.

do you have any suggestion?

thanks

always me :slight_smile:

I figured out that I need to update node to version ^10 || ^12 || >=14.

I found out about nvm (a new discovery for me, I didn’t know it) reading this.

the doubt that I have now is, how I can understand which node version I need to have in order to work with old trellis/sage projects?

this because on an old project, if I have the latest node version (14.15.4), I have errors when I run yarn && yarn build, but if I run “nvm use v8.9.4” it works fine.

so the question is, how can I find out what is the magic version that will work on that project (so I can use nvm and choose the right node version)?

thanks!

Yes, IMHO sage should have a .nvmrc file so a well-working (-building) node version is ensured across the team.

PR for Sage 9.x: