I'm trying to create a new ReactJS project by typing on cmd:
create-react-app new_project
But the cmd appear like this for hours and no change:
Creating a new React app in...
My node version: v10.16.3.
My npm version: 6.12.0.
Please help me to solve this problem. Thanks.
Try
npm install npm#latest -g
and run again
Similar problem's here
create-react-app hangs when initializing an app
It seems create-react-app not installed globally properly.
Try this
npm install -g create-react-app
the restart you system.
Now try using the command you used.
create-react-app new_project
Related
I've tried to create a new React App with every command from the official documentation
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
But I got every time the same result as shown here:
I tried to fully uninstall and reinstall Node.js; lower versions; I passed from 64bit to 32bit; tried to see if there was some conflicts but still nothing. Every suggestion will be loved
I fixed it by running this command:
npm audit fix --force
I had the same issue when I tried to run it with node v18... The only thing that worked was to use some previous version. If you're trying with v18, try to downgrade and see if it would work.
Unable to reach Expo servers. Falling back to using the cached dependency map (bundledNativeModules.json) from the package "expo" installed in your project.
Instead of writing npm start use expo start
This could be a network error. Try running the project with the offline flag: npx expo start --offline
if you are using expo cli -g 46 above
run:
npx expo start
Please consider this, and/or clarify the question.
Creating an expo app:
npx create-expo-app my-app
Navigating into project folder:
cd my-app
Launching an expo application:
expo start
Months ago, on my home PC I installed nodejs, react, etc., and got various tutorial sample projects working.
Now I’m remoting to my up-to-date Windows 10 work PC to install everything.
I’ve done the setup steps from the Traversy Media React Crash Course tutorial (5 stars), also just now, to double-check, watched the 1-minute video and reviewed the simple instructions at https://www.techomoro.com/how-to-install-and-setup-a-react-app-on-windows-10/ .
So I’ve installed nodejs from https://nodejs.org/en and downloaded react-0.14.3.zip (but there’s not an .msi installer, just a build folder and an examples folder… am I forgetting or missing something?)
Installed create-react-app globally:
PS C:\users\molin\dev\myapp> npm install -g create-react-app
…which spewed out…
C:\Users\molin\AppData\Roaming\npm\create-react-app -> C:\Users\molin\AppData\Roaming\npm\node_modules\create-react-app\index.js
[+ sign] create-react-app#4.0.1 updated 1 package in 7.639s
When I’m a level above the myapp folder and do either of these:
npx create-react-app .
npx create-react-app myapp
…or if I’m in the myapp folder and do either of these:
npx create-react-app myapp
npx create-react-app .
… I get the error:
Command failed: create-react-app spawn EPERM
Per a suggestion on a board, I ran this and retried, but no joy.
npm cache clean --force
I even rebooted and tried again.
No events show on the Window Event viewer.
Is this a permissions error on my work PC?
Thank you for any advice!
Reinstall react app globally
npm i -g create-react-app
Recreate your app -
create-react-app
(maybe this will help)
Got it working, jeez. In case this helps someone...
Opened VS Code; Undoubtedly didn't need to do this, but did File >
Open the folder myapp (which contained nothing yet)
Opened the VS Code terminal, cd .. to go a level up above the myapp folder;
npx create-react-app myappNEW , IOW a folder that didn't exist yet.
If I did that last command for "myapp", it gave the spawn error.
I had typed the following, but then tried it and it failed, so this is not the case: Conceivably, when doing this from the powershell, I didn't try npx (rather than npm) with a non-existent folder name.
No need for any other package install in your PC or System.
Install node
npm i node
create project
npx create-react-app project_name --template all
Please try these commands on your terminal:-
npx create-react-app my-app
cd my-app
npm start
I hope this will help you out.
You can also visit https://reactjs.org/docs/create-a-new-react-app.html for your reference.
It's my first time trying to use it, but after executing:
create-react-app myproject
I get:
Creating a new React app in C:\project
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
[ ................] \ fetchMetadata: sill resolveWithNewModule js-tokens#4.0.0
And it just hangs there forever.
I'm using npm 5.6.0 and create-react-app 2.0.3 on Windows 8.
I had this problem, mine got stuck at
Creating a new React app in C:\project
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
[ ................] \ fetchMetadata: sill resolveWithNewModule react-is#4.0.0
The solution for me was to ensure npm is up to date by running:
npm install npm#latest -g
After this, create-react-app worked correctly.
If you get stuck while running create-react-app, just Ctrl + C to end the process in the terminal or CMD.
Then end task "node.exe" from task manager (if you use windows).
Then run in your terminal:
npm install npm#latest -g
npm install create-react-app -g
npx create-react-app (your-project-name)
cd (your-project-name)
npm start (inside your code editor, e.g. VSCode)
Note: beware of npm vs npx in the commands used above
What I just did is press ctrl + C. My intention is to abort the process, but turns out the process is continue. Still not know any further logical explanation of the 'solution' that I just did, though.
Re-install Node js 32 bit.
My problem got fixed and same issue was there. Solution is to uninstall Node js and reinstall 32 bit Node js.....Enjoy Thanks
I was having the same problem, what i did is to run the command in nodejs command prompt instead of command prompt. it worked for me
Since you have npm 5.6.0, let try using npx
Open cmd:
Locate to you C:\project
C:
cd C:\project
Run npx and start the sample project with npm:
npx create-react-app myproject
cd myproject
npm start
npx come out since npm 5.2, and just read the document from create-react-app here
Open a new terminal/CMD, type resmon and hit enter. Go to overview tab and search for
cmd.exe (for windows users), straight to that, search for suspended. Yes this is the culprit. Right click on that suspended, and click 'resume process' and hit enter.
Click continue if any pop-up occurs :).
That's it you are done. you will see that your installation will continue :).
Repeat the same process if CMD hangs.
adding nodejs path in User Variable worked for me.
Try this; it worked for me:
npm install -g create-react-app
then run your command.
I'm trying to create a React project in WebStorm 2016.3.1
It's asking me for a create-react-app but I have no idea what that is and I can't find any reference on Google.
What is it and where can I find the value?
You need to install create-react-app npm module, before you use this feature.
npm install -g create-react-app
You can read more about this feature on the official release blog of WebStorm.
Excerpt from the documentation :
Make sure that you have create-react-app installed globally on your computer, for that run npm install -g create-react-app. Then to start your new project, double click on the start task in the npm tasks tool window to run it. That’s it!
I had ie installed create-react-app globally using yarn and webstorm failed to find it. Then I used npm, not to mention globally and its working like a charm.
TL;DRNo need to install anything. Just enter npx create-react-app in the create-react-app field & it should work like a pycharm, I mean charm :)
Side note: npx is pre-bundled with npm since npm version 5.2.0.
I created webStrom react app following this steps.
Download node.js
Open command line console and type "npm install -g create-react-app"
Create react app project from web-storm.
Make sure you provided the correct file path of create-react-app , by default it is
installed in ~\AppData\Roaming\npm\node_modules\create-react-app
use
npm start: to start development server
If you are using asdf or any other tool to manage multiple versions of nodejs, you will need to set up the path to create-react-app manually
I'm on mac, so for me the path was
/Users/<USER>/.asdf/installs/nodejs/12.16.2/.npm/lib/node_modules/create-react-app