Running npm on PowerShell asks "How do you want to open this file?", command line is fine

Viewed 5665

Whenever I run the npm command on Microsoft Windows PowerShell, it opens the Windows 10 popup asking What do you want to do with this file?... what do I want to open it with?

Here is a screen shot

But I can run node -v and it works fine. This means that I cannot do an "& npm install" from PowerShell to make it run cmd and that command.

Any ideas? I've looked around and no success...

2 Answers

In powershell run the command "get-command npm"

It may give you the wrong path.

I was getting the same error and the command told me it was finding npm in C:\WINDOWS\system32\npm

which was a 0 byte file. I deleted it and powershell now found the right path for npm.

Delete the 0 byte file path: C:\WINDOWS\system32\npm right click on npm and delete it.

Related