自动重新加载在编译过程中被卡住 [英] 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
推荐答案
您正在使用节点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.
由于您的项目现在正在发生 all 问题,因此节点可能是罪魁祸首.
Since your issues are happening with all your projects now, node could be the culprit.
这篇关于自动重新加载在编译过程中被卡住的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!