【发布时间】:2017-06-26 23:47:34
【问题描述】:
我正在为 angular 2 使用 angular-CLI,为了运行,我在 ng serve 获取模块构建失败后在命令提示符下执行 ng serve 'Cannot read property newLine of undefined' 错误,用于我的所有 angular 2 项目。
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (C:\Users\timebound\angularJson\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (C:\Users\timebound\angularJson\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (C:\Users\timebound\angularJson\node_modules\@ngtools\webpack\src\loader.js:329:31)
@multi webpack-dev-server/client?http://localhost:4300/./src/main.ts
我关注了angular cli issues,但我仍然无法修复,我是 angular 2 的新手,请帮助我
【问题讨论】:
-
请尝试详细说明您的问题。如果不具体,我们无法为您提供帮助。
-
即使在遵循 angular cli 升级说明后也有同样的问题,在我的应用程序中删除 node_modes 文件夹解决了它..
-
@frant.hartm 谢谢,我通过运行 npm start 而不是 ng serve 来解决它。
标签: angular typescript angular-cli