ng服务不会超出-10%构建模块3/3模块0有效

时间:2018-10-17 11:38:41

标签: angular npm angular-cli angular6 npm-install

我确实使用在Visual Studio Code中打开的代码在我的终端上服务。我得到了输出-

  ** NG Live Development Server is listening on localhost:4200, open 
  your browser on http://localhost:4200 **
   10% building modules 4/4 modules 0 active

没有超过10%。我也遇到错误-

 Your global Angular CLI version (6.2.5) is greater than your local
 version (1.3.0). The local Angular CLI version is used.

 To disable this warning use 
 "ng config -g cli.warnings.versionMismatch false".

所以我为角4运行了这些命令-

 npm install --save-dev @angular/cli@1.4.10
 npm install
 ng -v 

o / p-

Your global Angular CLI version (6.2.5) is greater than your local
version (1.4.10). The local Angular CLI version is used.

 To disable this warning use "ng config -g 
 cli.warnings.versionMismatch 
 false".
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

@angular/cli: 1.4.10
node: 8.9.4
os: linux x64
@angular/common: 4.3.4
@angular/compiler: 4.3.4
@angular/core: 4.3.4
@angular/forms: 4.3.4
@angular/http: 4.3.4
@angular/platform-browser: 4.3.4
@angular/platform-browser-dynamic: 4.3.4
@angular/router: 4.3.4
@angular/upgrade: 4.3.4
@angular/cli: 1.4.10
@angular/compiler-cli: 4.3.4
typescript: 2.4.2

现在我又跑了-

      ng serve

而且我的角度处理器没有超过10%-

** NG Live Development Server is listening on localhost:4200, open 
 your browser on http://localhost:4200/ **
 10% building modules 3/3 modules 0 active

请帮助。

1 个答案:

答案 0 :(得分:0)

您必须增加inotify观察者的数量

您可以通过执行以下行来设置永久的新限制

  

echo fs.inotify.max_user_watches = 524288 | sudo tee -a /etc/sysctl.conf

参考:Angular-cli ng serve livereload not working