在VSCode中使用yarn dev命令启动项目失败,错误:
yarn : File D:\Nodejs\yarn.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yarn dev
+ ~~~~+ CategoryInfo : SecurityError: (:) [], PSSecurityException+ FullyQualifiedErrorId : UnauthorizedAccess
解决办法:以管理员身份运行PoweShell,输入以下命令:然后输入Y重新运行yarn dev 即可,power shell命令如下:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser