使用 --watch 构建的 angular-cli 不观看

Max*_*Max 1 angular-cli

我遇到了一个问题,在 Ubuntu 17.04 上,@angular/cli@1.3.2命令ng build --watch在构建应用程序(成功)后退出并且没有开始观看。ng serve虽然工作正常并启动观察者。

我发现的最相似的问题是通过通过-opoption 或outDirproperty in设置输出路径来解决的,.angular-cli.json在我的情况下,这些似乎都没有帮助。关于可能是什么原因的任何想法?

更新

我的错,ng serve只是没有停止进程,观察者仍然没有工作。

Max*_*Max 5

鉴于更新,很明显问题在于一般观看而不是特定命令,所以我发现问题在于 LinuxInotify手表限制,可以通过任何一种方式扩展:

sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p --system
Run Code Online (Sandbox Code Playgroud)

或者

echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
Run Code Online (Sandbox Code Playgroud)

这样做的问题是限制在计算机重新启动时重置。

资料来源:

https://github.com/angular/angular-cli/issues/2356#issuecomment-278298550

https://github.com/angular/angular-cli/issues/2389#issuecomment-250964095