0

I'm working on a React project that is deployed using heroku. I just made an update to master and the pipeline failed. I've seen others ask what to do when they get "The engine "node" is incompatible with this module." errors when they have an older version of node. However, my pipeline failure indicates "Expected version "12.18.1". Got "10.23.0"". Since I have a newer version of node in my project I'm a bit confused on this. The files I cloned from the project's repo are what gave me the versions I'm using as I've verified prior commits were also using the 12.18.1 version. Does anyone have thoughts on this?

Jordan
  • 868
  • 1
  • 8
  • 25
Ryan
  • 97
  • 1
  • 12

2 Answers2

0

You will probably need to differentiate between your local version and the version used on heroku when deployed. Check this documenation link. Copied below

You should always specify a Node.js version that matches the runtime you’re developing and testing with. To find your version locally:

node --version

First, ensure that your application is using the heroku/nodejs buildpack

heroku buildpacks

Now, use the engines section of the package.json to specify the version of Node.js to use on Heroku. Drop the ‘v’ to save only the version number:

{
  "name": "myapp",
  "description": "a really cool app",
  "version": "1.0.0",
  "engines": {
    "node": "12.x"
  }
}

It’s recommended to use an x in the patch to get the latest patch updates from Node. A minor range (eg, 12.16) and an exact version (eg, 12.16.3) can be specified too.

Julian Kleine
  • 1,539
  • 6
  • 14
0
  • run this command to install nvm : curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
  • then run: nvm install 12.18.1

If you are getting an error of NVM then run: source ~/.nvm/nvm.sh

see How to change to an older version of Node.js