I'm trying to create a React application via npm create-react-app my app and I get this error:
I've installed npm install command. What is the problem with what I'm doing?
https://github.com/facebook/create-react-app
npx create-react-app my-app
cd my-app
npm start
You can't have spaces in the app name
Related
this is the error i am facing while creating react app.
I had tried below solution but it doesnot work for me
updated my npm using below command
npm i -g npm#latest
npm cache clear --force
yarn cache clear
npx create-react-app myapp --use-npm
I also check .npmrc folder in C:user>me> but still it not working
Node version
v16.15.0
Npm version
8.13.0
you don't need to use --use-npm
Simply use
npx create-react-app app-name
I'm trying to create-react-app but it's showing error
I've tried
npm cache clean --force
npx create-react-app .
Also used this but same issue occurs
npm install -g create-react-app
can anyone suggest how to fix this?
npx is used for the libraries in node_modules in your project
Since you used -g (meaning global) to install create react app you should use
npm create-react-app
If you add create-react-app to your package json with
npm install create-react-app
you can then use npx to run the command.
Check if your create react app version is compatible with your machine's node version. Upgrade or downgrade accordingly to match the two. This fixed the issue at my machine.
This is my first time trying out React and it's very demoralising to keep seeing the same error over and over again. I tried all three of these codes seperately
npx create-react-app myapp
npm init react-app myapp
npm install -g create-react-app then create-react-app myapp
All which gave me:
npm ERR! Unexpected end of JSON input while parsing near '...:"^5.0.0 || ^6.0.0"},'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\{hiddenForPrivacyReasons}\AppData\Roaming\npm-cache\_logs\2020-04-18T14_12_44_513Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from D:\{hiddenForPrivacyReasons}\codes\app
Done.
Help!!!
You don't need react-app and other scripts
Simply:
npx create-react-app my-app
cd my-app
npm start
Refer: document of create-react-app
I'm not able to create react app by create-react-app and it gives me an error
Try using npx create-react-app, be sure to have npm >= 5.2
First install create-react-app globally
npm install create-react-app -g
Then run the following command
create-react-app app-name
I am currently learning React. I have done:
npm i -g create-react-app (sucessful)
create-react-app react-app (sucessful)
cd react-app
npm start (error above)
Output:
npm start \Git\cmd was unexpected .at this time.
npm ERR! code ELIFECYCLE
So, what I have tried by searching online:
npm cache clean --force
delete node_modules
delete package-lock.json
npm run clear
npm install
None solved. I have read that I should not installed globally but now that it is already instaled (?) can I rollback? I can't run npm i g create-react-app again.
Thank you
Edit: Added screenshot
https://i.ibb.co/mNKLskX/Capturar.png
with npm try init
npm init react-app my-app
or, try npx:
npx create-react-app my-app
cd my-app
npm start
Have you tried to follow the steps from 'create-react-app'?
`To create a new app, you may choose one of the following methods:
npx
npx create-react-app my-app
(npx comes with npm 5.2+ and higher, see instructions for older npm versions)
npm
npm init react-app my-app
npm init is available in npm 6+
Yarn
yarn create react-app my-app
yarn create is available in Yarn 0.25+`
To have more info: https://github.com/facebook/create-react-app