0

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.

enter image description here

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.

enter image description here

R. Richards
25.2k10 gold badges67 silver badges65 bronze badges
asked Feb 12, 2019 at 21:57

2 Answers 2

1

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.

answered Feb 12, 2019 at 22:40
Sign up to request clarification or add additional context in comments.

Comments

0

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

answered Feb 12, 2019 at 22:20

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.