Skip to content

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

@bunyaminsg

Description

@bunyaminsg

Bug Report or Feature Request (mark with an 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions