当前位置:网站首页>yarn : 无法加载文件 D:xxx\node_global\yarn.ps1 因为在此系统上禁止运行脚本
yarn : 无法加载文件 D:xxx\node_global\yarn.ps1 因为在此系统上禁止运行脚本
2022-08-08 17:06:00 【csdn_aspnet】
记一次 yarn 错误排查解决。在 Windows 系统中使用 Windows PowerShell 执行 yarn 命令,报错为:
yarn : 无法加载文件 D:xxx\node_global\yarn.ps1,因为在此系统上禁止运行脚本,如下图:

导致此错误的原因是,PowerShell 执行策略,默认设置为Restricted不加载配置文件或运行脚本。需变更设置为RemoteSigned,变更过程为:
运行 Windows PowerShell(管理员),执行命令set-ExecutionPolicy RemoteSigned更改 PowerShell 执行策略,过程中提示询问是否要更改执行策略?,选择 A 或 Y 。如下图:

设置完毕,检验执行yarn config get registry命令,可正常加载执行脚本。
使用get-ExecutionPolicy命令,可查看当前 PowerShell 执行策略类型。
在vscode中执行 yarn install:


最后加载依赖包成功。
边栏推荐
- L2-008 最长对称子串 (25 分)
- ESP8266-Arduino编程实例-ADS1015(ADC)驱动
- LeetCode_二叉树_中等_515.在每个树行中找最大值
- 4. S32K14X study notes: S32 Design Studio new and imported projects
- leetcode:294.翻转游戏
- 【LeetCode】Exam Summary: Depth-First Search (DFS)
- ImportError: numpy.core.multiarray failed to import [cv2, matplotlib, PyTorch, pyinstaller ]
- vi编辑器命令
- 基于ECS实现一分钟自动化部署【华为云至简致远】
- 急了,Mysql索引中最不容易记的三个知识点通透了
猜你喜欢
随机推荐
leetcode:295. 数据流的中位数
Acwing第 63 场周赛【未完结】
JVM-简介&垃圾回收&内存泄漏分析
NSSCTF部分复现
activemq 消息头、消息体、消息属性
Cuda Anaconda tensorflow 版本对应
国内部分手机游戏开始显示用户IP属地
【论文阅读】RAL 2022: Receding Moving Object Segmentation in 3D LiDAR Data Using Sparse 4D Convolutions
开源项目管理解决方案Leantime
永续合约交易所系统开发逻辑详情
Acwing Week 63 [Unfinished]
L2-023 图着色问题 (25 分)
L2-027 名人堂与代金券 (25 分)
二、pytest+selenium+allure实现web ui自动化
Tensorflow教程(四)——MNIST项目入门
L2-020 功夫传人 (25 分)
phar反序列化
数字图像处理(六)—— 图像压缩
【入门PCB】立创eda的学习
laravel-实践









