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

Created on 16 Mar 2017  路  3Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

  • [x] bug report -> please search issues before submitting
  • [ ] feature request

Versions.


@angular/cli: 1.0.0-rc.2
node: 6.10.0
os: linux x64
npm version: 3.10.10

Repro steps.

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest
ng serve

The log given by the failure.

ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
    at Object.getNewLineCharacter (/home/bunyamin/WebstormProjects/c3dp/node_modules/typescript/lib/typescript.js:8062:20)
    at Object.createCompilerHost (/home/bunyamin/WebstormProjects/c3dp/node_modules/typescript/lib/typescript.js:44978:26)
    at Object.ngcLoader (/home/bunyamin/WebstormProjects/c3dp/node_modules/@ngtools/webpack/src/loader.js:202:31)
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

Desired functionality.


It was an existing project created by older version of angular-cli. It was working well before updating angular-cli, node and npm. After updates, it produced the error above by just typing ng serve.

Mention any other details that might be useful.

There is a similar issue which is closed (#3781) but I couldn't find a solution from it.

Most helpful comment

even I am getting the same error.

All 3 comments

even I am getting the same error.

Dupe of #3781, you can find an answer in https://github.com/angular/angular-cli/issues/3781#issuecomment-285020354.

I also suggest the RC update guide: https://github.com/angular/angular-cli/wiki/stories-rc-update

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings