Module build failed: TypeError: Cannot read property 'newLine' of undefined

前端 未结 7 877
春和景丽
春和景丽 2021-01-17 16:26

Everything was running fine yesterday, now when I try to ng serve I get these errors:

ERROR in ./src/main.ts Module build failed: TypeError

7条回答
  •  深忆病人
    2021-01-17 17:03

    This worked for me :-
    rm -rf node_modules && npm cache clean && npm uninstall --save angular-cli; npm uninstall -g angular-cli; npm i --save @angular/cli && npm i -g @angular/cli && npm i

    rm -rf node_modules/ in your project to get rid of all npm stuff and then npm cache clean followed by npm install should also resolve this issue. Also, make sure the versions of the cli locally and globally match.

    https://github.com/angular/angular-cli/issues/3781

提交回复
热议问题