I am using Azure static Web Apps to host my React website.
And I keep facing the error below.
yarn run v1.22.10
$ react-scripts build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
I have tried npx browserslist#latest --update-db for several times but it keep send run failed message to me.
and here is the entire error image
for all who are facing this problem ,
checkout this post Browserslist: caniuse-lite is outdated #1184
using npm i npm-update-all -g to update all outdated files can solve this issue
I have same problem in my Vue App.And in my case,yarn upgrade helps a lot.
In my case cleaning node_modules folder and reinstalling the packages helped:
# From the root of the repo
rm -rf node_modules
npx browserslist#latest --update-db
If you have multiple package.json files in the repository, check out how to clean all node_modules recursively
Related
While creating a new react app, getting this error.
Aborting installation. yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\.... \my-app has failed.
I know #5328 gave solution by removing . npmrc file here - https://github.com/facebook/create-react-app/issues/5328#issuecomment-429148117
I am new to react .. so can some one please let me know how do I find .npmrc file and how do i remove it? Or how do I create a new react app without having this error?
I know we can create a react app with the following command:
npx create-react-app my-app
or
yarn create react-app my-app
or
npm init react-app my-app
Thanks!
Okay,
I solved this problem by following the below steps:
npm install -g npm#latest
npm install node
npm install -g yarn
yarn cache clean
npx create-react-app my-app
I faced the same issue while creating a new app with CRA.
I tried all the below-mentioned solution:
1) Uninstall Yarn and install again.
2) yarn cache clean
3) npm uninstall -g create-react-app and install again.
Here's main issue:
error #typescript-eslint/eslint-plugin#2.13.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "10.11.0"
error Found incompatible module.
You may have got something similar. Look a couple of lines above "Aborting installation"
In my case, I was using Node version "10.11.0". I install a stable version of Node and it worked absolutely fine.
To double-check I tried to simulate the issue by changing the version with the help of NVM, and got the same issue.
Please refer to the error message and you'll figure out the culprit.
Note: I would still suggest keeping the updated and stable version of Yarn and CRA.
I want to create a react app although "npx create-react-app [app-name]" won't work in my project folder. I get the an "Incorrect integrity when fetching from the cache" error although I'm not familiar with why it's not fetching. The error is below.
=================================
Vincents-MacBook-Pro:Personal-Projects Vince$ npx create-react-app my-app
Creating a new React app in /Users/Vince/Documents/Coding-Projects/Personal-Projects/my-app.
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 Incorrect integrity when fetching from the cache
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/mountainthief/Documents/Coding-Projects/Personal-Projects/test-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting test-app/ from /Users/Vince/Documents/Coding-Projects/Personal-Projects
Done.
=================================
I've tried "npm cache clean --force" and uninstalling yarn to no avail.
What could I be missing?
npm cache clean --force
uninstall yarn
Creating a new React app in /Users/Vince/Documents/Coding-Projects/Personal-Projects/my-app.
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 Incorrect integrity when fetching from the cache
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/mountainthief/Documents/Coding-Projects/Personal-Projects/test-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting test-app/ from /Users/Vince/Documents/Coding-Projects/Personal-Projects
Done.
I expected a functional React-app complete with node-modules although I received the error:
yarn add v1.19.0
[1/4] π Resolving packages...
[2/4] π Fetching packages...
error Incorrect integrity when fetching from the cache
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
You can also see where the cache is with yarn cache dir.
yarn cache dir
Running yarn cache dir will print out the path where yarnβs global cache is currently stored. When you do a
yarn cache clean
You can check the folder actually cleans. If that fails you can manually delete it. yarn cache documentation
please run both commands again then install your app. Basically this types of error coming due to some package dependencies. So please install all both packages again.
npm install -g create-react-app
and reinstall yarn
If you getting same error after install both the please send me yarn and node version.
https://www.npmjs.com/package/npx
I had the same issue and it has resolved with upgrading global yarn packages.
$ yarn global upgrade
What fixed it for me was to delete the entire global yarn cache dir in the file system which I got via yarn cache dir, here's a one liner for that:
rm -rf `yarn cache dir`
After that yarn global upgrade made it work again:
yarn create react-app my-app --typescript
Happy hacking!
β¨ Done in 22.60s.
This was a simple folder permissions issue for me, a sudo resolved:
sudo npx create-react-app myApp
I'm trying to create a react app using npx's create-react-app command in ubuntu 18.04 terminal.
I have Node v12.8.0 installed. When I run the command npx create-react-app . in the directory of my app, I expect the react app boilerplate folders and files to be generated since I have the latest version of Node v12.8.0 and npm v6.10.2 in my machine.Instead, I get the below output...
npx: installed 91 in 5.725s
Creating a new React app in /home/<my-PC>/Documents/todo-app.
warning You are using Node "13.0.0-nightly20190802452b393c1f" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.17.3
warning You are using Node "13.0.0-nightly20190802452b393c1f" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
[1/4] Resolving packages...
[2/4] Fetching packages...
error #babel/core#7.5.5: The engine "node" is incompatible with this module. Expected version ">=6.9.0". Got "13.0.0-nightly20190802452b393c1f"
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 /home/<my-PC>/Documents/todo-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting todo-app/ from /home/<my-PC>/Documents
Done.
So it ends up deleting the generated app folder as soon as it's created. I think it is being affected by the Node "13.0.0-nightly20190802452b393c1f" specified above.
I have tried to locate it but I can't find it on my machine.
On the terminal, when I run node -v I get the version v12.8.0 which is for nodejs. Am stuck here...
Uninstall the node js from ubuntu software manager.
Then install node js with the following command:
sudo apt-get update
sudo apt-get install nodejs
If you have multiple versions of nodejs installed, you could target them directly with the -p option:
npx -p node#12
For create-react-app
npx -p node#12 create-react-app billion-dollar-project
I had the same error and forcing create-react-app to use npm instead of yarn fixed it. Try npx create-react-app appname --use-npm
Simply run the following:
create-react-app app-name --use-npm
This explicitly tells react to use npm instead of yarn.
So I'm trying to run reactjs official tutorial and with the first line of code:
npx create-react-app react-tutorial
...I get the following error:
npx: installed 91 in 12.692s
Creating a new React app in /home/foo/projects/react-tutorial.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.12.3
[1/4] Resolving packages...
warning react-scripts > fsevents#2.0.6: Please update: there are crash fixes
[2/4] Fetching packages...
[-----] 1/1297Missing dependencies in package.json
I read some where else to clean or force clean npm cache but that didn't work either:
npm cache clean --force
I'm on ubuntu running latest node (10.16.0) I also tried with 8.*
It seems that the error is discussed in this issue:
This seems to be a Yarn issue.
The workaround is to use npm instead of yarn:
create-react-app myproject --use-npm
If installing with npm you experience the following error:
npm ERR! cb() never called!
increase the ulimit in your .bashrc, .bash_profile, and/or .profile by updating (or removing) the below command:
ulimit -n 20000
Looks like you are using yarn instead of npm. Try --use-npm flag like this :
npx create-react-app react-tutorial --use-npm
I fixed this issue by installing yarn and then:
npx create-react-app my-app
cd my-app
npm start
Some people uninstalled yarn and used npm instead, I am not sure why npm did not work for me.
Try to upgrade npm version on your system.
Also upgrade your node.js version to the latest one.
I have solved this issue here all steps are written look into it..
reinstall npm(react) using the following command
npm install -g npm-reinstall
to some users, it may ask to audit fix do it
npm audit fix
npm audit fix --force
after it will take 2-5 min then write our command for creating a new project in react using npm
npx create-react-app amazon --use-npm
After the common step to start the server
cd amazon
npm start
I am having a problem creating a react app using, I keep getting an error.
I am using node v10.16.0 and npm v 6.9.0
I looked through many answers already and tried everything that has been suggested including reinstalling node, clearing cache etc.
I typed npx create-react-app clientinto the command prompt
and this is what I get.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.16.0
[1/4] Resolving packages...
error Received malformed response from registry for "react". The registry may be down.
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 C:\Users\xxxx\Documents\Work Project\client has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting client/ from C:\Users\xxxx\Documents\Work Project
Done.
Once you have cleaned the yarn cache by running:
yarn cache clean
Removing yarn cache folder in the AppData folder as well C:\Users\test\AppData\Local\Yarn
then subsequent calls to:
npx create-react-app your-app
This works for me well