vscode终端无法使用yarn

217 阅读1分钟

1.问题

在我们刚刚安装上yarn之后,可以使用yarn -V 或者yarn --version

但是当我们安装完yarn之后发现无法在vscode的终端中使用

由于vscode中的集成终端使用的是powershell,所以我们要设置一下powershell的执行权限

2.找到powershell

在C盘中输入C:\Windows\System32\WindowsPowerShell\v1.0 路径

image.png

也可以在开始页面直接搜索powershell

image.png

3.执行set-ExecutionPolicy RemoteSigned 回车,然后输入y

image.png

重启vscode即可