3
votes

After installing node and global create-react-app using 'npm install -g create-react-app' I start creating my first app using 'npx(or npm i tried both) create-react-app appname' and it was successfully created until I start the 'npm start' in 'appname' directory which gave me the following errors.

E:\Sang\React\myapp>npm start

[email protected] start E:\Sang\React\myapp react-scripts-start

'react-scripts-start' is not recognized as an internal or external command, operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-scripts-start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\Sang Tonsing\AppData\Roaming\npm-cache_logs\2020-09-03T12_06_34_133Z-debug.log

This is my script code inside package.json

{
"name": "myfirstreact",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
  ">0.2%",
  "not dead",
  "not op_mini all"
],
"development": [
  "last 1 chrome version",
  "last 1 firefox version",
  "last 1 safari version"
]
}
}

Kindly please help me solve my problem, I am planning to build my own website using react. Thank You so Much

4
Please post text, not images of text.Dave Newton
@DaveNewton, okay i have updated the text too.... Please check itSang Tonsing

4 Answers

0
votes

"scripts":{
"start":"react-scripts-start",
"build":"react-scripts-build",
"test":"react-scripts-test",
"eject":"react-scripts-eject",
}

you have to go to your package.json file and look inside scripts, you should see there start script. if you dont have just add it.

0
votes

In your package.json file change the start script as:

"scripts": {
   "start": "react-scripts start -o",
   "build": "react-scripts build",
   .
   .
   .

I think it's "start": "react-scripts-start" which is causing problem for you.

0
votes

You may be missing the react-scripts module. Run npm install react-scripts --save in your project and your package.json should be the way it was initially:

"scripts":{
"start":"react-scripts start",
"build":"react-scripts build",
"test":"react-scripts test",
"eject":"react-scripts eject",
}
0
votes
nvm install 10.23.0
npm start
npm run build