简体   繁体   中英

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?

这是一个屏幕截图

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

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.

删除0字节文件路径:C:\WINDOWS\system32\npm 右键npm删除。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM