Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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...

like image 376
Liquidice Avatar asked Jul 31 '17 14:07

Liquidice


1 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.

like image 167
Kenzie Revoyr Avatar answered Sep 21 '22 06:09

Kenzie Revoyr