Npm command not working in powershell but works in cmd

49 views Asked by At

C:\Users\user>npm --version The syntax of the command is incorrect.

Tried uninstalling and installing node the error persists.. Tried node installing 20,18 these two versions still same..

1

There are 1 answers

0
Filip Dupanović On

I would suspect it might be something to do with PATH being different between the cmd and ps environments, so some more debugging might help.

With Command Prompt:

echo %PATH%

With PowerShell:

echo $env:PATH