CFitz
CFitz

Reputation: 178

(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?

Upvotes: 2

Views: 5100

Answers (3)

Vasilis Georgoudis
Vasilis Georgoudis

Reputation: 77

You need to update your Node.js version. Try to

  1. Clear NPM's cache:

sudo npm cache clean -f

  1. Install a little helper called 'n'

sudo npm install -g n

  1. Install latest stable Node.js version

sudo n stable

Upvotes: 1

CFitz
CFitz

Reputation: 178

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!

Upvotes: 3

fabOnReact
fabOnReact

Reputation: 5942

I give you this list of checks to do from the react-webpack-rails-tutorial github page

Basic Demo Setup

  1. Be sure that you have Node installed! We suggest nvm, with node version v6.0 or above. See this article Updating and using nvm.

  2. git clone [email protected]:shakacode/react-webpack-rails-tutorial.git cd react-webpack-rails-tutorial

  3. Check that you have Ruby 2.3.0 or greater
  4. Check that you're using the right version of node. Run nvm list to check. Use 5.5 or greater.
  5. Check that you have Postgres installed. Run which postgres to check. Use 9.4 or greater.
  6. Check that you have qmake installed. Run which qmake to check. If missing, follow these instructions: Installing Qt and compiling capybara-webkit
  7. Check that you have Redis installed. Run which redis-server to check. If missing, install with Homebrew (brew install redis) or follow these instructions.
  8. bundle install
  9. brew install yarn
  10. yarn
  11. rake db:setup
  12. foreman start -f Procfile.hot
  13. Open a browser tab to http://localhost:3000 for the Rails app example with HOT RELOADING
  14. Try Hot Reloading steps below!
  15. foreman start -f Procfile.static
  16. Open a browser tab to http://localhost:3000 for the Rails app example.
  17. When you make changes, you have to refresh the browser page.

Upvotes: 0

Related Questions