0

When I run the following command:

npm install -g @angular/cli

I get the following error:

C:\Users\AA>npm install -g @angular/cli
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
C:\Users\AA\AppData\Roaming\npm\ng -> C:\Users\AA\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

@angular/[email protected] postinstall C:\Users\AA\AppData\Roaming\npm\node_modules\@angular\cli
node ./bin/postinstall/script.js

+ @angular/[email protected]
removed 1 package and updated 1 package in 15.551s

C:\Users\AA>
C:\Users\AA>ng --version
An unhandled exception occurred: ENOENT: no such file or directory, scandir 'C:\Users\AA\node_modules'
See "C:\Users\AA\AppData\Local\Temp\ng-MhKi22\angular-errors.log" for further details.

I have no idea, hope someone can help me out.

4
  • I have no idea, hope someone can help me out. I am using a proxy server because I have no one answer my question when I posted it in my country's website. Commented Jun 10, 2020 at 15:54
  • is this a brand new installation or are you upgrading a previous one? Commented Jun 10, 2020 at 17:46
  • first, I uninstall it and reinstall it. Commented Jun 11, 2020 at 7:13
  • While uninstalling it... did you remember to npm cache verify? Commented Jun 11, 2020 at 8:11

1 Answer 1

2

Angular is looking for a 'node_modules' subfolder in the app. You have not created any app, but Angular it's looking for one nevertheless. Type:

mkdir node_modules

And then execute again ng v

This error is a somewhat-well-document and recurrent error with angular-cli (see here). It's probably that you'll find additional errors when trying to run apps with ng serve. You'll probably have to install angular devkit with:

npm install @angular-devkit/core --save-dev

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.