franchyze923
franchyze923

Reputation: 1200

Angular npm ERR! Please try running this command again as root/Administrator windows 10

All of the sudden I get this error this morning - npm ERR! Please try running this command again as root/Administrator. I'm using windows 10 and Git bash.

This was when trying to simply create a new Angular project via ng new new-project. It's happened while doing other random things like installing the CLI tools and installing packages.

Sometimes I can resolve the issue by running Windows CMD as admin, other times that doesn't work. Sometimes if I just keep running the command, eventually it'll work?!!

I've tried a number of steps to resolve including -

I've seen quite a few posts about this. Has anyone come across this error lately?

I'm running -

Thanks

Upvotes: 0

Views: 1453

Answers (1)

Mateusz Korczynski
Mateusz Korczynski

Reputation: 11

Click Start. In the Start Search box, type cmd, and then press CTRL+SHIFT+ENTER. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.

cd [path to project]

and write your command again.

2 option (Works for me) install choco and reinstall npm as choco package.

Upvotes: 1

Related Questions