sh: react-scripts: command not found


(Software Engineer) #1

log file:

0 info it worked if it ends with ok
1 verbose cli [ ‘/Users/wmg/.nvm/versions/node/v10.15.3/bin/node’,
1 verbose cli ‘/Users/wmg/.nvm/versions/node/v10.15.3/bin/npm’,
1 verbose cli ‘start’ ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
5 info lifecycle project@0.1.0~prestart: project@0.1.0
6 info lifecycle project@0.1.0~start: project@0.1.0
7 verbose lifecycle project@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle project@0.1.0~start: PATH: /Users/wmg/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Volumes/DATA/Development/React/Nicolas/Nicolas(2019:3:07)/project/node_modules/.bin:/Users/wmg/.nvm/versions/node/v10.15.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle project@0.1.0~start: CWD: /Volumes/DATA/Development/React/Nicolas/Nicolas(2019:3:07)/project
10 silly lifecycle project@0.1.0~start: Args: [ ‘-c’, ‘react-scripts start’ ]
11 info lifecycle project@0.1.0~start: Failed to exec start script
12 verbose stack Error: project@0.1.0 start: react-scripts start
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess. (/Users/wmg/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:189:13)
12 verbose stack at maybeClose (internal/child_process.js:970:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
13 verbose pkgid project@0.1.0
14 verbose cwd /Volumes/DATA/Development/React/Nicolas/Nicolas(2019:3:07)/project
15 verbose Darwin 17.7.0
16 verbose argv “/Users/wmg/.nvm/versions/node/v10.15.3/bin/node” “/Users/wmg/.nvm/versions/node/v10.15.3/bin/npm” “start”
17 verbose node v10.15.3
18 verbose npm v6.4.1
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error project@0.1.0 start: react-scripts start
23 error spawn ENOENT
24 error Failed at the project@0.1.0 start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]


(John Gee) #2

Have you run npm install ?

npm start runs the script entry from your package.json called start. That looks like it has react-scripts start as the command, and I think the error is due to react-scripts not being found. e.g. not installed yet


(Software Engineer) #3

I have installed npm install -g react-script, then it seems it resolved.
I am not sure this is exact.