【问题标题】:Angular 2 typescript: Cannot read property newLine of undefinedAngular 2 typescript:无法读取未定义的属性newLine
【发布时间】: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


【解决方案1】:

将 devDependencies 从 "angular-cli": "1.0.0-beta.28.3" 更改为 "@angular/cli": "1.0.0-beta.30"

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2018-05-09
  • 2023-01-15
  • 2019-02-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-01
  • 2019-02-02
相关资源
最近更新 更多