Execute npm and yarn commands in VScode to report errors

Execute npm and yarn commands in VScode to report errors

insert image description here
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.
insert image description here
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 cmdto 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.

Guess you like

Origin blog.csdn.net/weixin_45626288/article/details/132491475