I am trying to create new app with create-react-app.
Below is the error.
Please help. Thanks in advance
➜ REACT create-react-app my-app
Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/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 /media/budi/Tjung/#TJUNG/REACT/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.
error image at CLI
Looks like network problem to me. You could be behind a proxy. If that is the case, configure your proxy in npm like this
npm config set proxy http://proxy_host:port
For https
npm config set https-proxy http://proxy.company.com:8080
Note: The https-proxy doesn't have https as the protocol, but http.
Optionally you can also try,
npm config set strict-ssl false
Checkout this SO answer
check if npm exists on your system.
try the commands in this order.
1. npm install --save create-react-app
2. create-react-app projectname
The name of the project must be in lowercase
Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:
npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "my-app":
create-react-native-app my-app
cd my-app
npm start
I have solve this problem.. it is about internet speed connection.
.
When I met this problem, I have spent one day to find out the solution. I read so many article about ETIMEDOUT. I had uninstall and re-install npm and yarn. Still doesn't solve my problem.
.
Until then I found the spot that has high speed internet connection. Fortunately I can create new app with create-react-app.
I think there are problem with your configurations of npm package.
Maybe somewhere, you set up some proxy configuration to npm variables.
You can reset configs running this script in terminal
sudo sh -c 'echo "" > $(npm config get globalconfig)'
and wait until process will end and run
exit
Open another terminal window and try
Related
When I try to create a react application using npx create-react-app blog it seems like nothing happened as you can see in this image
I have also tried to reinstall node js but it could not help me at all.
Note: I have tried after removing the spaces between the folder name
If I try to uninstall the globally installed react app the same issue, doesn't affect anything:
Note: I don't have much knowledge but i messed up with proxy last time before this issue.
Try installing npm first:
npm install -g npm#latest
Then install the create-react-app package.
npm install create-react-app
Thanks.
When I run npm start, I get this error. What is the solution for this?
This issue has been addressed here, you can refer to it.
Complete solution is
First add Poweshell to PATH as %SystemRoot%/system32/WindowsPowerShell/v1.0.
open powershell as admin and write this command Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force.
last thing fire npm-windows-upgrade.
Check your node version. update node & npm
try sudo npm start if you are in macOS or linux
try to download create-react-app again npm i -g create-react-app
try to create the app in another folder create-react-app APPNAME
Still not working? Then delete node module folder and run npm install
Not yet? delete both node module & package-lock.json and npm install
Try to run on another PORT
Hello guys i am trying to install react into my system but from 2 days i am facing the error for several times now. At first, i have used these commands to install react app and it was working fine for me
1. npm install -g creat-react-app
2. create-react-app reactapp
but form 2 days i was facing error while choosing these options to install, therefore I visited https://create-react-app.dev/docs/getting-started/ where it was clearly stated- If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version. Then i used the command npx create-react-app reactapp but i am facing this error. I have multiple time uninstalled nodejs and installed, also have used the command npm cache clean --forcetoo. But not working!!!!
e:\react-learn>npm uninstall -g create-react-app
removed 98 packages in 5.031s
e:\react-learn>npx create-react-app reactapp
npx: installed 98 in 39.888s
Creating a new React app in e:\react-learn\reactapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! Unexpected end of JSON input while parsing near '...wRDiDz3X/FqXhQ==","
sh'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dell\AppData\Roaming\npm-cache\_logs\2020-05-23T12_48_46_9
79Z-debug.log
How to resolve this error???And one interesting thing you know when i copied my previous project and run npm start it is working fine. What is the issue reactapp is justing eating my nerves...
Try clearing your cache and try again.
You can run
npm cache clean --force
or
npm cache clear --force
Try using npx create-react-app client --use-npm. Sometimes some issues arise due to package managers .
I have problems running my web app using this tutorial video React Native Web Full App Tutorial - Build a Workout App for iOS, Android, and Web
in react-native. I've been searching a lot for an answer but there is no accurate one yet that solves my issue.
I downloaded the app from here: git repo.
Try to use:
$ yarn
$ yarn install
$ npm install
$ npm config set #icons:registry https://registry.npmjs.org/
$ rm -rf node_modules
$ npm i https://github.com/Qix-/node-error-ex
$ curl 'https://registry.yarnpkg.com/#types/node/-/node-9.4.2.tgz'
but nothing seems to work, I keep getting this error.
error Couldn't find package "#wow/common#1.0.0" required by "#wow/app#0.0.1" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "#wow/common#1.0.0" required by "react-native-web-workout-series#0.1.0" on the "npm" registry.
at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:721:66)
at new MessageError (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:750:123)
at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:36539:17)
at Generator.throw (<anonymous>)
at step (/usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:310:30)
at /usr/local/Cellar/yarn/1.22.4/libexec/lib/cli.js:323:13
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Or any steps I need to follow to run this app. Since I want to download the app and edit the body content.
I tried to download and test it myself and it worked normally.
Clone it again and follow these steps:
#After cloning enter the folder
cd react-native-web-series
#install all dependencies
yarn install
#Navigate to the web folder
cd packages/web
#start the app
yarn start
Ps. : If a project is using yarn is not a good ideia to run npm commands, do not mix those two
In my case, the reason was the .npmrc file.
You can rename this file
mv ~/.npmrc ~/.npmrc2
npx create-react-app my-app
and rename it back after the installation.
mv ~/.npmrc2 ~/.npmrc
I ran into the same problem here.
And just as #Dmitry Grinko mentioned, it is related to .npmrc file.
I used private npm registry before so that some of package is missing.
Using following registry will pass the problem.
registry=https://registry.npmjs.org/
use npm login in terminal to login into your npm registry.
More information available here:
https://github.com/yarnpkg/yarn/issues/6029
npm install -g npm#latest
npm config set registry https://registry.npmjs.org/
If you're using nvm
nvm install 14.18.0
nvm use 14.18.0
nvm alias default 14.18.0
after look on the git repo - i think that maybe you should try to run npm i (or other commands - im not from react native area) in any package(app,common,web) to itself - like I saw any one of them has package.json of his own
I am trying to create a new react-app and start it, I have created react apps before with no errors but this time when i npm start i get this error
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix
locally.
The react-scripts package provided by Create React App requires a
dependency:
"webpack-dev-server": "3.1.14"
Don't try to install it manually: your package manager does it
automatically.
However, a different version of webpack-dev-server was detected higher up
in the tree:
C:\Users\ashraf\node_modules\webpack-dev-server (version: 3.1.9)
Manually installing incompatible versions is known to cause hard-to-debug
issues.
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to
an .env file in your project.
That will permanently disable this message but you might encounter other
issues.
To fix the dependency tree, try following the steps below in the exact
order:
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your
project folder.
2. Delete node_modules in your project folder.
3. Remove "webpack-dev-server" from dependencies and/or devDependencies in
the package.json file in your project folder.
4. Run npm install or yarn, depending on the package manager you use.
In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:
5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the
above steps with it instead.
This may help because npm has known issues with package hoisting which may
get resolved in future versions.
6. Check if C:\Users\ashraf\node_modules\webpack-dev-server is outside
your project directory.
For example, you might have accidentally installed something in your home
folder.
7. Try running npm ls webpack-dev-server in your project folder.
This will tell you which other package (apart from the expected react-
scripts) installed webpack-dev-server.
If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in
your project.
That would permanently disable this preflight check in case you want to
proceed anyway.
P.S. We know this message is long but please read the steps above :-) We
hope you find them helpful!
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! learnreact#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the learnreact#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ashraf\AppData\Roaming\npm-cache\_logs\2019-02-
04T20_36_39_924Z-debug.log
PS C:\Users\ashraf\Desktop\Files\LearnReact\learnreact>
i have tried all the steps in detail in the error log but its still not working, any thoughts on what is causing this error? Thanks in advance
It seems like you want to depend on webpack-dev-server inside your local project.
Perhaps you need to run npm install in your project, instead of your ~ home directory?
from your output, notice these lines.
However, a different version of webpack-dev-server was detected higher up
in the tree:
C:\Users\ashraf\node_modules\webpack-dev-server (version: 3.1.9)
...
6. Check if C:\Users\ashraf\node_modules\webpack-dev-server is outside
your project directory.
For example, you might have accidentally installed something in your home
folder.
so I would
cd ./my-project
npm i
Did you install webpack-dev-server on its own? It seems it has been installed either by you or by another project install. Webpack is for your local development environment so the other install is close enough to your project to interfere with the copy that react is trying to install in your project folder. Steps 1-4 in your error message should resolve your issue. If you have done that and its still not working, did you get different error messages with your next attempt to install your react package?
I have faced the same issue and this method worked for me.
Do follow the steps:
Start terminal from the desktop and write this command:
npm uninstall webpack-dev-server
This will uninstall webpack-dev-server package globally from you node modules.
Go back to you the terminal of your project and install webpack-dev-server package:
npm install webpack-dev-server#version
Note: The version part (above) should equal the versions asked for in the error message.
npm install webpack-dev-server
Now start npm:
npm start
This error mostly occurs when you have created your project using the
npx create-react-app command instead of the npm create-react-app command.