node.jsangularlite-server

Error occured when executing command: lite-server while npm start command for Angular2


My code repo is here, I'm running this on windows 8, node 7.9 & npm 4.2 I've done many things but got no solutino for this, googled for solution but got no lead.

 Error occured when executing command: lite-server
 Error: spawn cmd.exe ENOENT
     at exports._errnoException (util.js:1050:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
     at onErrorNT (internal/child_process.js:367: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:607:11)
     at run (bootstrap_node.js:423:7)
     at startup (bootstrap_node.js:147:9)
     at bootstrap_node.js:538:3
 Error occured when executing command: lite-server
 Error: spawn cmd.exe ENOENT
     at exports._errnoException (util.js:1050:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
     at onErrorNT (internal/child_process.js:367: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:607:11)
     at run (bootstrap_node.js:423:7)
     at startup (bootstrap_node.js:147:9)
     at bootstrap_node.js:538:3
[1] lite-server exited with code -4058

Solution

  • Changed the start to "tsc && concurrently "npm run tsc:w" "npm run lite" ",

    Installed run and lite globally by running command "npm install -g run", "npm install -g lite"

    And it worked. Issue resolved!