Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
The "@angular/compiler-cli" package was not properly installed

Upgrading my project to Angular 4.0 (from 2.4) with Angular CLI 1.0 (from beta.31), I get the error below after following the migration guide:

> ng build --prod

The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
    at Object.<anonymous> (/home/jan/src/fm-repos/fm-ui/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.<anonymous> (/home/jan/src/fm-repos/fm-ui/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)

My angular dependencies post-migration:

"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@angular/cli": "1.0.0",
"@angular/material": "2.0.0-beta.3",

Note: this similar question is about Angular 2 project: Angular2 CLI error "@angular/compiler-cli" package was not properly installed

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Ensure you have TypeScript 2.2 in your package.json and ensure your tsconfig is properly updated.

Details:

With Angular CLI 1.0 installed, create a new dummy project:

ng new dummy

then remove the node_modules directories:

rm -rf ./dummy/node_modules
rm -rf ./myproject/node_modules

and diff the changes between the dummy project and your project:

diff -bur ./dummy/ ./myproject/

Of the many changes, the crucial change necessary to address this error for me was TypeScript and tsconfig changes:

package.json:

"typescript": "~2.0.3" ==> "typescript": "~2.2.0"

.angular-cli.json

Change:

"tsconfig": "tsconfig.json"

to:

"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",

and add these new files from your dummy project, and install your packages:

npm install
about 4 years ago · Santiago Trujillo Report

0

I create new fresh installation in Linux machine _ _ ____ _ _ / \ _ __ __ _ _ _| | __ _ _ __ / | | | | / △ \ | ' \ / _| | | | |/ _ | '| | | | | | | / \| | | | (| | || | | (| | | | || | | | // __| ||__, |__,||__,|| ____|_____|| |/ @angular/cli: 1.0.1 node: 6.10.2 os: linux x64

Aftere i create new angular 2 project using

ng new angularhellword

Project successfully created but when i execute command

ng serve

Given me above same error like

The "@angular/compiler-cli" package was not properly installed.

Please take the following steps to avoid issues:

"npm uninstall --save-dev angular-cli"

"npm install --save-dev @angular/cli@latest"

It works for me and project run successfully.

about 4 years ago · Santiago Trujillo Report

0

npm uninstall -g angular-cli
rm -rf ./node_modules
rm package-lock.json
npm install --save-dev @angular/cli@latest

if installing the latest version still gives you an error you can run through the process again of uninstalling and manually enter the version of angular-cli after verifying the newest release in the angular-cli repo. My package.json listed ^1.3.0, but there was a beta version just released and when i manually changed it to

"@angular/cli": "^1.3.0-beta.0"    
npm i

It installed successfully

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!