请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

启动服务启动不了,一直报错,node js 6.10

> webapp@0.0.0 start E:\apptest\webapp

> ng serve


module.js:471

    throw err;

    ^


Error: Cannot find module 'E:\apptest\webapp\node_modules\angular-cli\bin\ng'

    at Function.Module._resolveFilename (module.js:469:15)

    at Function.Module._load (module.js:417:25)

    at Module.runMain (module.js:604:10)

    at run (bootstrap_node.js:393:7)

    at startup (bootstrap_node.js:150:9)

    at bootstrap_node.js:508:3


npm ERR! Windows_NT 6.1.7601

npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "start"

npm ERR! node v6.10.1

npm ERR! npm  v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! webapp@0.0.0 start: `ng serve`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the webapp@0.0.0 start script 'ng serve'.

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 webapp package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     ng serve

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!     npm bugs webapp

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls webapp

npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:

npm ERR!     E:\apptest\webapp\npm-debug.log


Process finished with exit code 1


正在回答 回答被采纳积分+3

1回答

Mishy 2017-04-03 21:04:37

全局安装@angular/cli

0 回复 有任何疑惑可以回复我~
  • 提问者 jeanneze #1
    试了一下,还是报错,还在尝试,谢谢啦
    回复 有任何疑惑可以回复我~ 2017-04-05 10:46:39
  • 提问者 jeanneze #2
    全局安装后,还得把配置文件中的angular-cli改成@angular/cli,重新配置angular-cli.json->
     "environmentSource":"environments/environment.ts",
          "environments": {
            "dev": "environments/environment.ts",
            "prod": "environments/environment.prod.ts"
          }
    之后才能运行成功
    回复 有任何疑惑可以回复我~ 2017-04-05 11:18:20
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信