Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

enter image description here

Everything was running fine yesterday, now when I try to ng serve I get these errors:

ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'newLine' of undefined at Object.getNewLineCharacter (/Users/leongaban/Projects/TickerTags/wikitags/node_modules/typescript/lib/typescript.js:8062:20)

I tried the answers here and here but no effect :(

My global and local npm version for angular-cli is 1.0.0-beta.28.3 how do I upgrade that to .30? I tried @latest


My local package.json:

"devDependencies": {
    "@angular/cli": "1.0.0-beta.28.3",
    "@angular/compiler-cli": "^2.4.0",

My global package:

enter image description here


I see that the latest is beta.32 https://github.com/angular/angular-cli/releases

However when I run npm install -g angular-cli@latest it still installs .28.3

like image 788
Leon Gaban Avatar asked Feb 23 '17 15:02

Leon Gaban


2 Answers

OS : Windows with Angular 4

"@angular/cli": "1.2.1"

"@angular/material": "2.0.0-beta.6"

I just removed the caret from above two dependencies and performed following steps, everything started working perfectly.

  1. Remove node_module
  2. Uninstall angular cli from local and global
  3. Install the same version of angular cli in both
  4. Do "npm install"
  5. "ng serve"
like image 174
prabhatojha Avatar answered Nov 15 '22 07:11

prabhatojha


In package.json I changed:

"devDependencies": {
   "@angular/cli": "1.0.0"

To:

"devDependencies": {
   "@angular/cli": "1.2.0"
like image 2
Chris Schwab Avatar answered Nov 15 '22 06:11

Chris Schwab