解决方法:
执行命令获得命令的位置
get-command npm得到如下

然后删除或者修改 npm.ps1文件 让其不能使用就行。然后重启vscode即可。
pnpm 同理即可

另外加速源 国内镜像源(淘宝):
npm config set registry https://registry.npmmirror.com/pnpm config set registry https://registry.npmmirror.com/
yarn config set registry https://registry.npmmirror.com/