Skip to content

Cannot find module '@angular/compiler-cli' when running ng serve #4725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ib467 opened this issue Feb 15, 2017 · 40 comments
Closed

Cannot find module '@angular/compiler-cli' when running ng serve #4725

Ib467 opened this issue Feb 15, 2017 · 40 comments

Comments

@Ib467
Copy link

Ib467 commented Feb 15, 2017

Error: Cannot find module '@angular/compiler-cli'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/plugin.js:5:24)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:5:10)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/models/webpack-configs/typescript.js:4:19)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/models/webpack-configs/index.js:9:10)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/models/webpack-config.js:4:27)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/tasks/serve.js:10:26)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Class.run (/usr/local/lib/node_modules/@angular/cli/commands/serve.js:74:27)
at Class. (/usr/local/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)

@angular/cli: 1.0.0-beta.31
node - v7.5.0
npm - 4.1.2

Please help when running ng serve, the angular cli not found error comes up.

@clydin
Copy link
Member

clydin commented Feb 16, 2017

Can you provide your package.json?
Please also run and provide the output of npm ls @angular/compiler-cli from within the project directory.

Also, in the future, please use the provided issue template to allow assistance to be rendered in a more timely manner.

@FredvanRijswijk
Copy link

FredvanRijswijk commented Feb 16, 2017

OS?

macOS Sierra

Versions.

@angular/cli: 1.0.0-beta.31
node: 6.9.5
os: darwin x64
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/compiler-cli: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7

Repro steps.

Update NPM and new install of npm and angular cli on new MacBook Pro with macOS Sierra...

The log given by the failure.

ng serve
Cannot find module '@angular/compiler-cli'
Error: Cannot find module '@angular/compiler-cli'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/plugin.js:5:24)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:5:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/models/webpack-configs/typescript.js:4:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/models/webpack-configs/index.js:9:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/models/webpack-config.js:4:27)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/@angular/cli/tasks/serve.js:10:26)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Class.run (/usr/local/lib/node_modules/@angular/cli/commands/serve.js:74:52)
at Class. (/usr/local/lib/node_modules/@angular/cli/ember-cli/lib/models/command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.

package.json:

{
"name": "myapp",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.4.7",
"@angular/compiler": "^2.4.7",
"@angular/compiler-cli": "^2.4.7",
"@angular/core": "^2.4.7",
"@angular/forms": "^2.4.7",
"@angular/http": "^2.4.7",
"@angular/material": "^2.0.0-beta.2",
"@angular/platform-browser": "^2.4.7",
"@angular/platform-browser-dynamic": "^2.4.7",
"@angular/router": "^3.4.7",
"@types/node": "^6.0.63",
"angularfire2": "^2.0.0-beta.7-pre",
"codelyzer": "^2.0.0",
"core-js": "^2.4.1",
"firebase": "^3.6.9",
"hammerjs": "^2.0.8",
"rxjs": "^5.1.1",
"ts-helpers": "^1.1.1",
"tslint": "^4.4.2",
"zone.js": "^0.7.7"
},
"devDependencies": {
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.24",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.0.2",
"typescript": "~2.0.3"
}
}

npm ls @angular/compiler-cli:

myapp@0.0.0 /Users/xx/xx/xx/xx/xx
└── @angular/compiler-cli@2.4.7

@AlejandroSilva
Copy link

this happens to me too, just after runing:
$ npm remove -g angulat-cli
$ npm install -g @angular/cli

@Empereol
Copy link

Empereol commented Feb 16, 2017

Remove angular-cli from your package.json and replace it with @angular/cli

$ npm uninstall angular-cli
$ npm install @angular/cli --save-dev

That seemed to work for me.

@asiftasleem
Copy link

Getting same error "ng serve". Working on happy-shopper github project.

@asiftasleem
Copy link

Same error even after changing to @angular/cli

@asiftasleem
Copy link

I don't have @angular/compiler-cli as a dependency. Trying now after adding it.

@asiftasleem
Copy link

Now getting TypeError: patterns.map is not a function

@AlejandroSilva
Copy link

AlejandroSilva commented Feb 16, 2017

got it, to upgrade from "angular-cli" to "@angular/cli" run this:

update angular-cli to the latest version

$ npm remove -g angular-cli
$ npm install -g @angular/cli@latest

update the project dependencies

$ rm -rf node_modules dist
$ npm install --save-dev @angular/cli@latest
$ npm install

source:
https://github.com/angular/angular-cli#updating-angular-cli

@asiftasleem
Copy link

after that I updated angular-cli.json and following advice worked for me:
#3566

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

package.json file below -----

{
"name": "donsky-acc",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.1.0",
"@angular/compiler": "^2.1.0",
"@angular/core": "^2.1.0",
"@angular/forms": "^2.1.0",
"@angular/http": "^2.1.0",
"@angular/platform-browser": "^2.1.0",
"@angular/platform-browser-dynamic": "^2.1.0",
"@angular/router": "^3.1.0",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular/compiler-cli": "^2.1.0",
"@types/jasmine": "^2.2.30",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.20-4",
"codelyzer": "~1.0.0-beta.3",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5"
}
}

@clydin
Copy link
Member

clydin commented Feb 16, 2017

Please follow the steps listed here: https://github.com/angular/angular-cli#updating-angular-cli
And also remove angular-cli.
If afterwards, you still are having issues, please let us know.

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

still problem continues..

Macbook-pro:donsky_acc macbookpro$ npm install -g @angular/cli@latest

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "@angular/cli@latest"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2

npm ERR! Cannot read property 'path' of null
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /Users/macbookpro/code/donsky_acc/npm-debug.log

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

{
"name": "donsky-acc",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.1.0",
"@angular/compiler": "^2.1.0",
"@angular/core": "^2.1.0",
"@angular/forms": "^2.1.0",
"@angular/http": "^2.1.0",
"@angular/platform-browser": "^2.1.0",
"@angular/platform-browser-dynamic": "^2.1.0",
"@angular/router": "^3.1.0",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular/compiler-cli": "^2.1.0",
"@types/jasmine": "^2.2.30",
"@types/node": "^6.0.42",
"@angular-cli": "1.0.0-beta.31",
"codelyzer": "~1.0.0-beta.3",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5"
}
}

changed angular-cli to @angular-cli in the devdependencies on package.json file

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

You have to be inside an Angular CLI project in order to use the serve command.

@sublimator
Copy link

@angular/cli not @angular-cli

God, this isn't very much fun is it :(

Where's TypeScript 2.1 support ? Does it work ?

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

made the change @angular/cli
still not working, this is not fun at all.

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

package.json

{
"name": "donsky-acc",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "^2.1.0",
"@angular/compiler": "^2.1.0",
"@angular/core": "^2.1.0",
"@angular/forms": "^2.1.0",
"@angular/http": "^2.1.0",
"@angular/platform-browser": "^2.1.0",
"@angular/platform-browser-dynamic": "^2.1.0",
"@angular/router": "^3.1.0",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular/compiler-cli": "^2.1.0",
"@types/jasmine": "^2.2.30",
"@types/node": "^6.0.42",
"@angular/cli": "1.0.0-beta.31",

"codelyzer": "~1.0.0-beta.3",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5"

}
}

@sachasayan
Copy link

sachasayan commented Feb 16, 2017

Having the same issue, after an angular-cli -> @angular/cli upgrade. It's an unmet peerdep with @angular/cli-compiler.

Fixed by doing:

npm uninstall angular-cli -g
npm uninstall angular-cli --save
npm install -g @angular/cli
npm install @angular/cli --save
npm install @angular/compiler-cli --save

However, surely there's a better way.

@Ib467
Copy link
Author

Ib467 commented Feb 16, 2017

macbook-pro:donsky_acc macbookpro$ sudo npm install @angular/cli --save
Password:
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "@angular/cli" "--save"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 74.125.224.72:8888
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR! /Users/macbookpro/code/donsky_acc/npm-debug.log

this problem still continues, thanks ssayan for your note

@sublimator
Copy link

sublimator commented Feb 17, 2017 via email

@Ib467
Copy link
Author

Ib467 commented Feb 17, 2017

thanks sublimator...had to uninstall node/npm on mac. then installed using brew.
this link below has some great points to follow inorder to fix npm access issues / and others when installing angular-cli
https://gist.github.com/DanHerbert/9520689
**note if someone comes across this issue on a mac os see link above.

@malinn
Copy link

malinn commented Feb 23, 2017

I had identical problem. After trying all your suggestions, this is the line that finally worked for me:
mv angular-cli.json .angular-cli.json

@QadMohKuwait
Copy link

I had the same problem but realized that I was in project folder, just CD to the solution folder and done

@Zuushi
Copy link

Zuushi commented Sep 21, 2017

Hey,

I had the same issue when I tried to install Material for my Angular 4 project, here is what I've done step by step (using Windows) :

Note : First, you need to have node.js, npm, angular/cli installed and configured.

Step 1 : Open cmd.exe and create a new project :
C:\Users\...\angulartutorial> ng new "MyAppProject"

Step 2 : Change your console location to your new project's directory :
C:\Users\...\angulartutorial> cd "MyAppProject"

Step 3 : Install Angular Material :
C:\Users\...\MyAppProject> npm install --save @angular/material @angular/animations

Step 4 : Now you are in trouble you need to get more packages...
There should be some "npm WARN... You must install..." lines...
Just install packages needed (if there are packages with the same name, install the higher version) :
C:\Users\...\MyAppProject> npm install --save @angular/core@4.4.3 @angular/cdk @angular/common

Step 5 : New packages sometimes need more packages :
C:\Users\...\MyAppProject> npm install --save rxjs zone.js

Step 6 : Your application is not working yet, you have few more packages to install :
C:\Users\...\MyAppProject> npm install --save @angular/compiler-cli
C:\Users\...\MyAppProject> npm install --save @angular/compiler@4.4.3
C:\Users\...\MyAppProject> npm install --save typescript

Step 7 : It is important to update npm to get new packages working together :
C:\Users\...\MyAppProject> npm update

Step 8 : Now, install the last package :
C:\Users\...\MyAppProject> npm install --save @angular/cli

Step 9 : Mount the local server :
C:\Users\...\MyAppProject> ng serve

Step 10 : Enjoy ! You should be able to acces your application with this URL :
http://localhost:4200/

Hope this help !

@aakanksha08
Copy link

Hi,
I am facing the following problem with Angular2, while running ng serve, the follwing errors come

ERROR in g:/firebase-crud/src/providers/af.ts (3,55): Cannot find module 'angula
rfire2'.
ERROR in g:/firebase-crud/src/app/app.module.ts (5,35): Cannot find module 'angu
larfire2'.
ERROR in Error: Error encountered resolving symbol values statically. Could not
resolve angularfire2 relative to g:/firebase-crud/src/app/app.module.ts., resolv
ing symbol AppModule in g:/firebase-crud/src/app/app.module.ts, resolving symbol
AppModule in g:/firebase-crud/src/app/app.module.ts, resolving symbol AppModule
in g:/firebase-crud/src/app/app.module.ts
at Error (native)
at syntaxError (g:\firebase-crud\node_modules@angular\compiler\bundles\comp
iler.umd.js:1729:34)
at simplifyInContext (g:\firebase-crud\node_modules@angular\compiler\bundle
s\compiler.umd.js:25111:23)
at StaticReflector.simplify (g:\firebase-crud\node_modules@angular\compiler
\bundles\compiler.umd.js:25123:13)
at StaticReflector.annotations (g:\firebase-crud\node_modules@angular\compi
ler\bundles\compiler.umd.js:24553:41)
at _getNgModuleMetadata (g:\firebase-crud\node_modules@angular\compiler-cli
\src\ngtools_impl.js:138:31)
at _extractLazyRoutesFromStaticModule (g:\firebase-crud\node_modules@angula
r\compiler-cli\src\ngtools_impl.js:109:26)
at Object.listLazyRoutesOfModule (g:\firebase-crud\node_modules@angular\com
piler-cli\src\ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (g:\firebase-crud\node_m
odules@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (g:\firebase-crud\node_modules@ngtoo
ls\webpack\src\plugin.js:207:44)
at _donePromise.Promise.resolve.then.then.then.then.then (g:\firebase-crud\n
ode_modules@ngtools\webpack\src\plugin.js:443:24)
at process._tickCallback (internal/process/next_tick.js:109:7)

webpack: Failed to compile.

@nathiyakumar
Copy link

The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'
Error: The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'
at Object. (/home/finix/Downloads/angular4-1/ng4-material/node_modules/@ngtools/webpack/src/index.js:14:11)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/finix/Downloads/angular4-1/ng4-material/node_modules/@angular/cli/tasks/eject.js:10:19)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/finix/Downloads/angular4-1/ng4-material/node_modules/@angular/cli/models/webpack-configs/styles.js:6:17)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)

@nathiyakumar
Copy link

i have repeat error

@666lili666
Copy link

hi can you please help? what is wrong?

ng serve
The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'
Error: The "@angular/compiler-cli" package was not properly installed. Error: Error: Cannot find module '@angular/compiler-cli'
at Object. (C:\Users\Moran\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\webpack\src\index.j
s:14:11)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Moran\AppData\Roaming\npm\node_modules@angular\cli\tasks\eject.js:10:19)
at Module._compile (module.js:624:30)

at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Moran\AppData\Roaming\npm\node_modules\@angular\cli\models\webpack-configs\styles.js:6:17)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)

here is the json.package:
{
"name": "ofri-directory",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.4.4",
"@angular/cdk": "^2.0.0-beta.11",
"@angular/common": "^4.4.4",
"@angular/compiler": "^4.4.4",
"@angular/core": "^4.4.4",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/material": "^2.0.0-beta.11",
"@angular/platform-browser": "^4.4.4",
"@angular/platform-browser-dynamic": "^2.3.1",
"@angular/platform-server": "^4.4.4",
"@angular/router": "^3.3.1",
"core-js": "^2.4.1",
"rxjs": "^5.4.3",
"ts-helpers": "^1.1.1",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.4.4",
"@angular/compiler-cli": "^4.4.4",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0",
"typescript": "^2.6.0-dev.20170930"
}
}

thanks

@kprocks86
Copy link

npm install -g @angular/cli@latest
works for me ,
thanks .

@ghost
Copy link

ghost commented Oct 5, 2017

@AlejandroSilva Thanks a lot. Spent an hour struggling with this error and your suggestion fixed it

@sidm033
Copy link

sidm033 commented Jan 21, 2018

npm install @angular-devkit/core --save-dev
Worked for

@guntram
Copy link

guntram commented Jan 24, 2018

@S-iddhartha ty alot! this is the only thing which worked for me... :)

@anupammaurya
Copy link

anupammaurya commented Jun 12, 2018

Uninstall node
Delete folder Angular folder from Appdata>>Roaming>>...

  • restart
  • npm i
  • npm -g update npm
  • npm uninstall -g @angular/cli angular/cli
  • npm cache clean
  • npm install -g @angular/cli

@Jaimerojo
Copy link

@SSayan work for me!!!!

@keyil
Copy link

keyil commented Jan 17, 2019

C:\Users\Softlogic\solo> npm install
npm ERR! Unexpected end of JSON input while parsing near '...e":"circular-json","v'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Softlogic\AppData\Roaming\npm-cache_logs\2019-01-17T13_40_06_342Z-debug.log

@kamranmasud
Copy link

Cannot find module '@angular/compiler-cli'
Error: Cannot find module '@angular/compiler-cli'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users\honey\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:12:24)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users\honey\node_modules@ngtools\webpack\src\index.js:13:10)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (C:\Users\honey\node_modules@angular-devkit\build-angular\src\angular-cli-files\models\webpack-configs\typescript.js:4:19)
at Module._compile (internal/modules/cjs/loader.js:701:30)

Please help me out ?

@gugodo
Copy link

gugodo commented Apr 8, 2019

got it, to upgrade from "angular-cli" to "@angular/cli" run this:

update angular-cli to the latest version

$ npm remove -g angular-cli
$ npm install -g @angular/cli@latest

update the project dependencies

$ rm -rf node_modules dist
$ npm install --save-dev @angular/cli@latest
$ npm install

source:
https://github.com/angular/angular-cli#updating-angular-cli

work for me... thanks!

@rujutat
Copy link

rujutat commented Aug 19, 2019

Cannot find module '@angular/compiler-cli/ngcc'. Please help

package.json -
{
"name": "apac-employees-staffing",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.json --ssl true",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/cdk": "^7.3.7",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/material": "^7.3.7",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"@ncstate/sat-popover": "^3.2.0",
"@types/jquery": "^3.3.29",
"bootstrap": "^4.3.1",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"jquery": "^3.4.1",
"jw-react-modal": "^1.0.3",
"material-ui": "^0.20.2",
"ngx-tooltip": "0.0.9",
"react-edit-inline": "^1.0.8",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.5.2",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.0",
"@angular/cli": "~7.3.9",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}

npm ls @angular/compiler-cli
`-- UNMET PEER DEPENDENCY @angular/compiler-cli@7.2.15

npm ERR! peer dep missing: @angular/compiler-cli@^8.0.0-beta.0 || ^8.1.0-beta.0 || ^8.2.0-beta.0 || ^8.3.0-beta.0 || ^8.4.0-beta.0 || >=9.0.0-beta < 9, required by @angular-devkit/build-angular@0.802.1

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests