Arvind Chourasiya
Arvind Chourasiya

Reputation: 17402

Why ng commands works only with 'as admin' in Vs Code and Command prompt

I am running in a issue last two days. When I open Vs code and Cmd as admin then only able to run ng commands.

Getting error

'ng' is not recognized as an internal or external command,
operable program or batch file.

To get admin credentials everytime I need to raise a ticket. Always I dont have admin credentials.

How can I fix this issue?

I have below configuration

Node.js: C:\Program Files\nodejs
npm:     C:\Users\Username\AppData\Roaming\npm

Angular CLI: 9.1.9
Node: 12.15.0

Environment variable in Path

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
C:\Users\Username\AppData\Local\Programs\Microsoft VS Code\bin
C:\Users\Username\AppData\Roaming\npm
C:\Program Files\nodejs
C:\Users\Username\node_modules\.bin

Upvotes: 0

Views: 1921

Answers (1)

Arvind Chourasiya
Arvind Chourasiya

Reputation: 17402

Fixed by uninstalling and reinstalling node.js (from programs and features) .

Upvotes: 3

Related Questions