Execute npm and yarn commands in VScode to report errors
I use vnm to install npm, and I can run it on the Windows+R interface to view the version; but an error is reported in VScode.
After checking a lot of information, the reason for my situation is that the terminal used by default in VScode is Powershell
, and then I switched to the system cmd
to run successfully. The specific reason: in VSCode, it uses an independent PowerShell process. If If you haven't configured PowerShell's environment variables correctly, then it may not be able to find npm commands.