I installed the Angular CLI (or so I thought) using the command prompt but when I check the version, it is not there.
Keyed: cd "C:\Dans\Work 2\Tech\Dot Net\Asp.Net Core\MVC web api with Angular7\master\gym-project" Hit enter.
Keyed: npm install -g @angular/cli Hit enter.
It indicates it updated.
But when I go to check the version, It get an error and there is no 'node_modules' folder in the path as there should be.
2 Answers 2
First off, you are installing @angular/cli at a global level. This will not create a 'node_modules' folder in the current directory.
You are getting an error when you try to use ng --version because you are in a directory that has a package.json file (which I imagine has a local version of @angular/cli specified) but there is no local 'node_modules' folder.
Solution:
npm i
This will read the package.json file and locally install all of the node modules required for the project in a 'node_modules' folder that it will create. After that, your ng --version command should work.
Comments
Try creating a directory called node_modules at C:\Dans\Work 2\Tech\Dot Net\Asp.Net Core\MVC web api with Angular7\master\gym-project". Then close your terminal, reopen your terminal, navigate to the above mentioned path, and issue a ng version and ng help to see if the issue persists. If it does I would reinstall angular cli.
Hopefully that helps