Angular 2 typescript: Cannot read property newLine

2019-02-26 21:01发布

问题:

I am using angular-CLI for angular 2, for running I am doing ng serve in command prompt after ng serve getting module build failed 'Cannot read property newLine of undefined' error for all my angular 2 projects.

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

I followed angular cli issues,still i am not able to fix, i am newer to angular 2, please help me

回答1:

change the devDependencies from "angular-cli": "1.0.0-beta.28.3" to "@angular/cli": "1.0.0-beta.30"