自动重新加载在编译期间卡住 [英] Auto-reload gets stuck during compilation
问题描述
我不知道是什么原因造成的.几天前我没有这个问题,但最近,每当我编辑任何一行代码时,自动重新加载都会在 Compiling...
期间卡住:
I have no idea what's causing this. A few days ago I didn't have this problem but lately, whenever I edit any line of code, the auto-reload gets stuck during Compiling...
:
chunk {main} main.js, main.js.map (main) 302 kB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
ℹ 「wdm」: Compiling...
它不会终止,我必须kill ng
并重新启动整个过程.
It't not terminating and I have to kill ng
and restart the whole thing.
这会在 10 到 20 次自动重新加载后发生 - 一开始一切正常.
This happens after like 10 to 20 auto-reloads - at the beginning everything is working.
我已经 rm -rf node_modules
- 显然是修复 npm
问题的经典方法 - 并重新安装了所有模块,但没有用.
I already rm -rf node_modules
- the classic way to fix npm
issues apparently - and re-installed all modules but that didn't work.
如果我可以为您提供任何其他信息,请告诉我.
Please let me know if I can give you any additional information.
更新:
我将 angular-cli 更新到 7.0.6,但我仍然遇到同样的问题.这个问题似乎存在于我的所有项目中.
I updated angular-cli to 7.0.6 and I still have the same problem. This issue seems to be present in all my projects.
$ ng --version
Angular CLI: 7.0.6
Node: 11.0.0
OS: linux x64
Angular: 7.1.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, material, material-moment-adapter, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.10.6
@angular-devkit/build-angular 0.10.6
@angular-devkit/build-optimizer 0.10.6
@angular-devkit/build-webpack 0.10.6
@angular-devkit/core 7.0.6
@angular-devkit/schematics 7.0.6
@angular/cli 7.0.6
@angular/flex-layout 7.0.0-beta.19
@angular/language-service <error>
@ngtools/webpack 7.0.6
@schematics/angular 7.0.6
@schematics/update 0.10.6
rxjs 6.3.3
typescript 3.1.6
webpack 4.19.1
(旧)环境
$ ng --version
Angular CLI: 6.2.2
Node: 11.0.0
OS: linux x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.8.2
@angular-devkit/build-angular 0.8.2
@angular-devkit/build-optimizer 0.8.2
@angular-devkit/build-webpack 0.8.2
@angular-devkit/core 0.8.2
@angular-devkit/schematics 0.8.2
@angular/cdk 6.4.7
@angular/cli 6.2.2
@angular/flex-layout 6.0.0-beta.18
@angular/material 6.4.7
@angular/material-moment-adapter 6.4.7
@ngtools/webpack 6.2.2
@schematics/angular 0.8.2
@schematics/update 0.8.2
rxjs 6.3.3
typescript 2.9.2
webpack 4.19.0
推荐答案
您使用的是 node 11.0.0,我们可以在您提供的版本输出中看到.
You're using node 11.0.0, we can see that in the version output you provided.
如果您降级到节点 8.13.0 或 10.13.0(编写本文时为当前 LTS),您可能会走运.
If you downgraded to node 8.13.0, or 10.13.0 (current LTS when writing this), you might have better luck.
我的经验是,使用 最新功能 版本的 node 并不总是一个好主意.有时似乎有些小问题,例如您遇到的问题.我过去总是喜欢使用最新和最好的节点,但我发现它可能会导致问题.
My experience has been that being on the Latest Features version of node isn't always a good idea. There sometimes seems to be little issues, like what you are having. I used to always like to be on the latest and greatest when it came to node, but I found it can cause problems.
由于您的问题现在发生在您的所有项目中,节点可能是罪魁祸首.
Since your issues are happening with all your projects now, node could be the culprit.
这篇关于自动重新加载在编译期间卡住的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!