0

I need to run the command npm cache clean --force as admin in my daily builds.

I am currently using the command:

<Exec Command="npm cache clean --force" workingDirectory="$(SolutionRoot)\Angular" />

and it fails with the following error:

npm ERR! Please try running this command again as root/Administrator.

Deepanshu Kalra
  • 419
  • 2
  • 9
  • 23

1 Answers1

-1

This has nothing to do with MSBuild, nor the Exec task. What you have to do is login as a user with admin credentials to get this to work.

But first of all, ask why or what is requiring admin credentials in the first place?

C.J.
  • 15,637
  • 9
  • 61
  • 77