npm yarn 启动报错【已解决】

我的网站已上线 http://javapub.net.cn/

@

问题描述:

vscode中使用 yarn sreve 启动项目时报错:

PS D:\javapub\JavaPub-Blog> yarn install       
yarn : 无法加载文件 C:\Users\wangshiyu\AppData\Roaming\npm\yarn.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID
=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ yarn install
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

解决

使用管理员身份打开 cmd 执行

set-ExecutionPolicy RemoteSigned

在这里插入图片描述

设置淘宝镜像

yarn config set registry https://registry.npm.taobao.org/npm

再试试

我的网站已上线 http://javapub.net.cn/

posted @ 2022-04-21 23:04  JavaPub  阅读(236)  评论(0编辑  收藏  举报