Angular2 CLI error "@angular/compiler-cli" package was not properly installed

I had the same problem. I resolved it following the "Updating Angular CLI" process in the npm @angular/cli page, that is:

1. Uninstall and clean (global)

rm -rf node_modules dist
npm uninstall -g @angular/cli
npm cache clean

2. Reinstall and play (global)

npm install -g @angular/cli@latest
npm install
ng serve

This worked for me.


I've tried everything in these answers and the only thing that worked for me was the following:

Step 1: npm install -g @angular/cli@latest
Step 2: ng new name-of-project (ignore if project already created)
Step 3: cd name-of-project (ignore if project already created)
Step 4: npm install @angular/cli --save-dev
Step 5: npm install @angular/compiler-cli --save-dev
Step 6: ng serve

Tested these steps in two different environments

Inside of project folder, type "npm install" and wait the installation finishes, this fix works fine for me.


There is an issue with version

"@angular/cli": "1.0.0-rc.4"

Try to install older one

"@angular/cli": "1.0.0-rc.2"

This same error can also occur if you upgrade to Angular 4 and don't update Typescript to 2.1.0.