"npm install" does not install @angular/cli, @angular/compiler-cli and @angular-devkit/build-angular properly

1.4k Views Asked by At

I am trying to install npm using the npm install command, and all the packages are installed except @angular/cli, @angular/compiler-cli and @angular-devkit/build-angular.

I tried installing them individually, but it is not working. Please tell me how to fix this problem.

Illustration:

enter image description here

2

There are 2 best solutions below

0
On

I suspect you have production set to true in your environment, which will prevent the members of devDependencies from being installed. You can install them anyway under that circumstance passing the --production option with the install command, like:

npm install --production=false

You can read more about how dependencies are installed and handled by NPM in the NPM documentation for the install command. The future should note that this link is to the v7 documentation.

0
On

This solved it for me:

npm link @angular/cli

In my case, I looked in the node_modules folder, and angular seemeded to be there, but the ng command was still not available. the command above fixed that for me. I also tried to delete the entire node_modules folder and redo the npm install but this did not solve it.