I am trying to create a new react project (I work on Mac OS).
To do that, according the documentation, I enter this :
npx create-react-app bet-front
I obtain this error :
yarn add v1.3.2
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
error #typescript-eslint/eslint-plugin#2.24.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1".
error Found incompatible module
I updated my node version (here), I have now : v12.16.2
I updated npm version, I have now : 6.14.4
Despite these upgrades, I have the same errors to create a new react project. Do I have the right versions of these tools to create a new react project ? What can I do more ?
Edit 1
I already tried this without success, and same error : npm init react-app bet-front
Edit 2
I uninstalled node and npm and re installed it. And then retried the command to create a new React project. And no changes : same error about the #typescript-eslint/eslint-plugin#2.24.0.
I finally succeeded to create this new react project :
sudo npm i -g create-react-app
I do not know why it works using sudo ! usually I do not need it. Strange !
I came across the same issue after updating my node and npm versions. Used this link as guidance: https://phoenixnap.com/kb/update-node-js-version.
I didn't realize my nvm version was also out of date and finally was able to run create-react-app!
You can check your nvm version like so:
nvm -ls
Then check for the latest version available:
nvm ls-remote
Finally, install:
nvm install [version-number]
Hope this helps you as it did for me!
Related
I am trying to install Storybook on my project. All I do is initialize the create-react-app and then cd to the current directory. When I enter 'npx sb init' I am getting the following errors:
โข Detecting project type. โ
โข Adding Storybook support to your "Create React App" based project
Unable to find versions of #storybook/react using npm
Unable to find versions of #storybook/addon-links using npm
Unable to find versions of #storybook/addon-essentials using npm
Unable to find versions of #storybook/addon-actions using npm
Unable to find versions of #storybook/node-logger using npm
Unable to find versions of #storybook/preset-create-react-app using npm
System
Node: v16.13.0
NPM: 8.1.4
Ubuntu 21.10
Notes
I was able to find a relatable problem here, but unfortunately it doesn't seem logical to init the project on a VM and then copy it locally..
I'm using Ubuntu 20.04.
I had the same issue. The problem was that I had installed node through snap. https://github.com/nodesource/distributions/blob/master/README.md - here is the example how to install on Debian / Ubuntu without using snap.
i need some help because i recently start to work on my macbook (until my ubuntu VM) and i have some trouble with the installation.
And now when i load my old project i got this :
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/gauloix/Documents/GitHub/BuyTheWay-FRONT/src/index.js: Unexpected token (10:0)
obviously i missed something during the pkg installation or something witch brew :/
If the error was to obvious dont blame me i've just finised my formation and i'm newbie ^^'
image description here
Thanks beforehand !
This might be error of babel library .
Try this "npm install -D babel-loader#latest #babel/core#latest #babel/preset-env#latest" installation . It might helpfull.
First of all, I would suggest you to use nvm for managing different Node.JS versions. Installing it is easy:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Once installed, you can install and use any Node.JS version with simple commands like:
# Install the latest Node.JS version
nvm install node
# Install a specific version
nvm install 6.14.4
# Use Node.JS version marked as "default"
nvm use node
# Or use some other version
nvm use node6
Once you have nvm ready, use npx to create a completely new React app and try to start it:
npx create-react-app myAppName
cd myAppName
npm start
If you don't get any errors during this process, I would suggest to simply overwrite newly created React app with your old code, excluding package.json. Before running the app with overwritten code, uninstall all packages you installed globally for the time being:
# List all globally installed packages
npm list -g -depth 0
# Use `npm uninstall` and uninstall them all:
npm uninstall whatever-globally
Finally, you will probably need to install some other dependencies (check your old package.json) manually:
npm install dep-1 dep-2 dep-3 ...
And then try to run the project with:
npm start
I've Installed Create-react-app globally in my system but I'm unable to create react projects with it.I have followed similar issues on stackoverflow but none of them have a solution.
My Node version: 12.16.2
My NPM version : 6.14.4
Please help me to move on with this.
When I try to create a new react app with create-react-app, I got the following:
ยป npx create-react-app my-order
Creating a new React app in /Users/ian/myproject/my-order.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.19.0
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz: Request failed \"404 Not Found\"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/ian/myproject/my-order/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Users/ian/myproject/my-order has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.
And my local environment information is like this:
ยป npx create-react-app --info
Environment Info:
System:
OS: macOS 10.14.6
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU # 2.50GHz
Binaries:
Node: 11.1.0 - /usr/local/bin/node
Yarn: 1.19.0 - ~/.yarn/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Browsers:
Chrome: 80.0.3987.100
Firefox: 72.0.2
Safari: 12.1.2
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: 2.1.1
Anyone have any idea what's going on here?
Try
yarn install --registry=https://registry.yarnpkg.com/
it worked for me
Sometimes there is a problem accessing npmjs.com and installing scoped packages. Try to check https://status.npmjs.org/
If you use NVM, you might have this problem occur if you switched away from your primary nodejs version that you first had installed, so just change back if you can:
nvm use <original node installation's version>
But, if that doesn't work for you, then in your shoes I'd try reinstalling node directly from the website if I can't just use a non-NVM installation: https://nodejs.org/en/
For some people it seems they have an EACCESS error, and that might be fixed by changing their registry from http to https.
Example using NPM, rather than Yarn:
npm install --registry=https://registry.npmjs.org/
A similar problem: Cannot run npm install from nvm, but working well using source from https://nodejs.org/en/download/
Try with yarn install --registry=https://registry.yarnpkg.com/.
Hope it works!
Try this in your command:
yarn cache clean
yarn
and it will probably work...
I too get the error An unexpected error occurred: "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz: Request failed \"503 Service Unavailable\""
I changed from var to let in my code and It works fine.
I have never had an error before running create-react-app, but when I have run it on my Mac today I keep getting the below error and have not been able to resolve it. I've tried updating node, Yarn, eslint, CRA, and also clearing the node cache and nothing works. Why is this error occurring and how can I resolve it so I can install create-react-app?
Creating a new React app in /Users/...
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.10.1
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
error eslint#5.6.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.3.0"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Users/johnwolfe/printPackageTest/printtest has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting printtest/ from /Users/johnwolfe/printPackageTest
Done.
Error
error eslint#5.6.0: The engine "node" is incompatible with this
module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.3.0"
error Found incompatible module
Question
Why is this error occurring and how can I resolve it so I can install
create-react-app?
Answer
You might consider updating your NodeJS version :) It's quite clear that it's an incompatible issue between your NodeJS and the create-react-app
I was facing the same issue, try to add "--use-npm" at the end of create react app commend.
create-react-app appname --use-npm
Happy hacking!