Search code examples
ruby-on-railsnode.jsyarnpkgreact-on-rails

(React on Rails) The engine "node" is incompatible with this module. Expected version "..."


For those familiar with the react-on-rails gem, or more generally, yarn:

Just today I updated my Node version to 8.8.1 via Homebrew. Now, when I attempt to run bundle && yarn && foreman start -f Procfile.dev (or just yarn install), I get the following message:

error [email protected]: The engine "node" is incompatible with this module. Expected version "5.10.0".

error Found incompatible module

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

This is likely a very simple issue I am running into, but I have been unable to fix it after a few hours of debugging.

I tried manually updating my Node version in package.json to be that on my computer (did not seem to take effect whatsoever), downgrading my version to 5.10.0 via Homebrew (but was unable to), and even upgrading to the latest version of the gem which meant installing webpack as well.

No matter what I did, my local server startup (bundle && yarn && foreman start -f Procfile.dev) still lead to the same error above. Any ideas for this poor soul?


Solution

  • For anyone running into this same issue, I have not found a solution for the underlying issue but I have found a temporary workaround.

    Simply run

    bundle && yarn --ignore-engines && foreman start -f Procfile.dev
    

    instead of

    bundle && yarn && foreman start -f Procfile.dev
    

    I hope this helps someone else that may have found themselves stuck in the same situation!