Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create-react-app failing with error: node incompatible with css-loader

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

[email protected]: 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.

like image 702
katjass Avatar asked Oct 07 '18 09:10

katjass


2 Answers

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
like image 117
Tarek Avatar answered Sep 17 '22 12:09

Tarek


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.

like image 36
katjass Avatar answered Sep 17 '22 12:09

katjass