5

I'm simply trying to create a react app with the command npx create-react-app my-app but get this error:

css-loader@1.0.0: The engine "node" is incompatible with this module. Expected version ">= 6.9.0 <7.0.0 || >= 8.9.0". Got "8.5.0"

I've tried updating node but it seems to not work, checking the version it says 8.5.0 just like in the error. Even restarted my computer as a last option but that also didn't help..

Is there anything else I could try? Any suggestions are welcome.

katjass
  • 197
  • 2
  • 22

4 Answers4

6

I had the same thing and spent few hours trying to figure it out. I think it was the webpack. Finally, I ended updating the node.

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Tarek
  • 61
  • 1
  • 1
    Thank you, indeed node needed to be updated. For me it didn't work even with that command though. – katjass Oct 08 '18 at 08:29
3

Finally realised the problem was my old version of node, I had nvm installed and had to update which node version I'm using with nvm use node.

Update:

I had to use that command every time I started a new terminal session. Also had problems when some other packages were picking up the wrong node version for some reason.

That can be fixed with the command nvm alias default 10.11.0, or which ever version you want to use.

katjass
  • 197
  • 2
  • 22
1

I can confirm that

nvm install node --reinstall-packages-from=node

worked well for me.

bubbaspaarx
  • 616
  • 4
  • 15
0

I had the same problem, Als tried some stuff and after updating the lates version of node with nvm it worked. I got it from this website: https://bytearcher.com/articles/ways-to-get-the-latest-node.js-version-on-a-mac/

nvm install node --reinstall-packages-from=node
codeGirl
  • 1
  • 1