0

Well, i'm starting with Angular 2 right now, and in the first QuickStart example, i'm facing this issue with "npm start":

C:\nodejs\apps\angular2\01-cadastro-contatos>npm start

> angular-quickstart@1.0.0 start C:\nodejs\apps\angular2\01-cadastro-contatos
> tsc && concurrently "npm run tsc:w" "npm run lite"

 Error occured when executing command: npm run lite
 Error: spawn cmd.exe ENOENT
     at exports._errnoException (util.js:1020:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
     at onErrorNT (internal/child_process.js:376:16)
     at _combinedTickCallback (internal/process/next_tick.js:80:11)
     at process._tickCallback (internal/process/next_tick.js:104:9)
     at Module.runMain (module.js:606:11)
     at run (bootstrap_node.js:383:7)
     at startup (bootstrap_node.js:149:9)
     at bootstrap_node.js:496:3
 Error occured when executing command: npm run lite
 Error: spawn cmd.exe ENOENT
     at exports._errnoException (util.js:1020:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
     at onErrorNT (internal/child_process.js:376:16)
     at _combinedTickCallback (internal/process/next_tick.js:80:11)
     at process._tickCallback (internal/process/next_tick.js:104:9)
     at Module.runMain (module.js:606:11)
     at run (bootstrap_node.js:383:7)
     at startup (bootstrap_node.js:149:9)
     at bootstrap_node.js:496:3
[1] npm run lite exited with code -4058

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\nodejs\apps\angular2\01-cadastro-contatos\npm-debug.log

I tried many things found on this site, but without success. I'm on Windows 10 x64...

Can you help me?

1 Answers1

0

Install these packages globally first, like so:

npm install -g concurrently
npm install -g lite-server
npm install -g typescript

Next, delete the node_modules folder and run npm install. Re-run npm start then. If that fails, open package.json (in your project dir) and change

"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" "

to

"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "

In case it somehow fails to escape the quotation marks properly, which happens, change it to:

"start": "concurrently "npm run tsc:w" "npm run lite" "

And then re-run npm start again.

Milan Velebit
  • 1,933
  • 2
  • 15
  • 32
  • 1
    Just a note: If you're going to put `concurrently` `lite-server` and `typescript` in npm script, you don't need to install them globally. Local modules will be used. – AdityaParab Oct 16 '17 at 11:46
  • True, but I added it in just in case as he's beginning to develop with Ang and might need those packages throughout more projects. Voted up. – Milan Velebit Oct 16 '17 at 11:50
  • Edited the answer, try again. If all that fails, reinstall node completely and re-do it. It's a bug either due to the typescript compiler or Node itself. – Milan Velebit Oct 16 '17 at 12:09