0

I am trying to run create-react-app and keep getting an error about updating my node version:

The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0"

I found this post and tried using sudo n stable. The output was:

installed : v12.14.0 to /usr/local/bin/node
active : v11.10.0 at /Users/Kristin/.nvm/versions/node/v11.10.0/bin/node

I am noting here that the version I have installed is 12.14.0 but 11.1.0 is the one being used. Could that be the issue?

After that, I did the following:

npm install create-react-app -g

create-react-app myappname

I was unable to install create-react-app due to this error:

npm WARN saveError ENOENT: no such file or directory, open '/Users/Kristin/flatiron/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/Kristin/flatiron/package.json'
npm WARN flatiron No description
npm WARN flatiron No repository field.
npm WARN flatiron No README data
npm WARN flatiron No license field.

Is it possible that I am still running the incorrect version of node or is there something else going on here?

Thank you in advance for your time and advice!

arvidrus
  • 157
  • 2
  • 14
  • npm install create-react-app -g you need to install create-react-app with the flag -g which means install the package globally – Muhammad Zia Jan 03 '20 at 16:42
  • @MuhammadZia I did that and then ran `create-react-app myappname` and still got this error `The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0"` – arvidrus Jan 03 '20 at 16:54
  • it's obvious the nodeJs version that you have installed is not compatible with cra. Try installing the latest stable version from this [link](https://nodejs.org/en/) – Muhammad Zia Jan 03 '20 at 17:04
  • I did that already. When I ran `sudo n stable` this was the output. `installed : v12.14.0 to /usr/local/bin/node active : v11.10.0 at /Users/Kristin/.nvm/versions/node/v11.10.0/bin/node` Is there an issue with the installed v active? – arvidrus Jan 03 '20 at 17:10
  • you need to uninstall everything even nodeJs and install it again. I know it kind of sounds silly but many problems are solved this way, simply just uninstalling and installing things again – Muhammad Zia Jan 03 '20 at 17:19
  • Ok, so `npm uninstall node -g` and then `npm install node -g`? – arvidrus Jan 03 '20 at 17:22
  • no, how did you install npm the first time ? – Muhammad Zia Jan 03 '20 at 17:23
  • npm comes pre-packaged with node > 5.6 I think, u don't need to install it manually – Muhammad Zia Jan 03 '20 at 17:24
  • checkout this [answer](https://stackoverflow.com/questions/5650169/uninstall-node-js-using-linux-command-line) for guide on how to uninstall node and npm completly – Muhammad Zia Jan 03 '20 at 17:26

3 Answers3

1

try

npx -p node@<input_desired_version_here> -- npx create-react-app my-app --template typescript

found here https://github.com/facebook/create-react-app/issues/9614

jd2rogers2
  • 21
  • 1
  • 5
0

try to install create-react-app globally with: npm install -g create-react-app

Mahdi N
  • 2,128
  • 3
  • 17
  • 38
  • 1
    I did that and then ran `create-react-app myappname` and still got this error `The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.10.0"` – arvidrus Jan 03 '20 at 16:56
0

Try deleting what you already have with npm uninstall -g create-react-app, then globally install npm install -g create-react-app. You can read the documentation at https://create-react-app.dev/docs/getting-started/

  • Thank you @wellington. I went there and used npx, npm, and yarn and have still not resolve the issue. – arvidrus Jan 03 '20 at 17:02