启动时角度克服服务器错误

时间:2016-11-08 09:26:53

标签: angularjs angular-cli

我已经安装了angular-cli,并且我正在尝试提供服务'通过" ng [BLAH] FrontEnd"创建一个Angular项目,但我收到了这些错误:

pastebin:http://pastebin.com/QB1D5PsF

发生了什么事。当我导航到http://localhost:4200/时,我看到了:

Uncaught Error: Cannot find module "webpack-dev-server/client?http://localhost:4200/"(…)

2 个答案:

答案 0 :(得分:2)

尝试npm start代替ng servehttp://localhost:4200/

运行服务器

答案 1 :(得分:1)

试试这个

使用此

更新根目录中存在的angular-cli文件
"defaults": {
    "styleExt": "css",
    "component": {},
    "serve": {
      "port": 4200
    }
  }

将此添加到package.json

"ng": "ng",
"start": "ng serve"