Peter Zacharias Peter Zacharias - 1 month ago 8
React JSX Question

'npm start' does not work anymore

My npm start does not work anymore, but I still worked with it yesterday. I also haven't changed anything, as far as I'm concerned. I'm using it to start up my react starter kit (facebooks official starterkit). What could it be?

> apicalltestapp@0.1.0 start /Users/.../reactapp
> react-scripts start

module.js:457
throw err;
^

Error: Cannot find module 'cross-spawn'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/reactapp/node_modules/.bin/react-scripts:2:13)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/dswork/.nvm/versions/node/v6.7.0/bin/node" "/Users/dswork/.nvm/versions/node/v6.7.0/bin/npm" "start"
npm ERR! node v6.7.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! apicalltestapp@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the apicalltestapp@0.1.0 start script 'react-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the apicalltestapp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs apicalltestapp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls apicalltestapp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/dswork/Coding/reactcafe/npm-debug.log


here is the npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/Users/dswork/.nvm/versions/node/v6.7.0/bin/node',
1 verbose cli '/Users/dswork/.nvm/versions/node/v6.7.0/bin/npm',
1 verbose cli 'start' ]
2 info using npm@3.10.8
3 info using node@v6.7.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle apicalltestapp@0.1.0~prestart: apicalltestapp@0.1.0
6 silly lifecycle apicalltestapp@0.1.0~prestart: no script for prestart, continuing
7 info lifecycle apicalltestapp@0.1.0~start: apicalltestapp@0.1.0
8 verbose lifecycle apicalltestapp@0.1.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle apicalltestapp@0.1.0~start: PATH: /Users/dswork/.nvm/versions/node/v6.7.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/dswork/Coding/reactcafe/node_modules/.bin:/Users/dswork/.nvm/versions/node/v6.7.0/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle apicalltestapp@0.1.0~start: CWD: /Users/dswork/Coding/reactcafe
11 silly lifecycle apicalltestapp@0.1.0~start: Args: [ '-c', 'react-scripts start' ]
12 silly lifecycle apicalltestapp@0.1.0~start: Returned: code: 1 signal: null
13 info lifecycle apicalltestapp@0.1.0~start: Failed to exec start script
14 verbose stack Error: apicalltestapp@0.1.0 start: `react-scripts start`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/Users/dswork/.nvm/versions/node/v6.7.0/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/Users/dswork/.nvm/versions/node/v6.7.0/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:877:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid apicalltestapp@0.1.0
16 verbose cwd /Users/dswork/Coding/reactcafe
17 error Darwin 15.6.0
18 error argv "/Users/dswork/.nvm/versions/node/v6.7.0/bin/node" "/Users/dswork/.nvm/versions/node/v6.7.0/bin/npm" "start"
19 error node v6.7.0
20 error npm v3.10.8
21 error code ELIFECYCLE
22 error apicalltestapp@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the apicalltestapp@0.1.0 start script 'react-scripts start'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the apicalltestapp package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error react-scripts start
23 error You can get information on how to open an issue for this project with:
23 error npm bugs apicalltestapp
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls apicalltestapp
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Answer

As I see you lost cross-spawn

  1. Check your package.json/npm-shrinkwrap.json has cross-spawn dependency. If you have not, then run npm i --save cross-spawn
  2. If you have, then remove folder node_modules.
  3. Run npm install

It will fix.

Comments