Search code examples
node.jsreactjsherokunode-modules

Why am I getting an error about my node version when I have a newer version than is requested?


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?


Solution

    • 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