当前位置:网站首页>yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本
2022-07-06 09:35:00 【JackieDYH】
错误信息
yarn : 无法加载文件 D:\ProgramFiles\nodejs\yarn.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ yarn run serve
+ ~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
终端进程“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command yarn run serve”已终止,退出代码: 1。

主要原因是powershell的执行策略阻止了此次操作
解决
在powershell命令行
windows下运行*.ps1脚本(powershell的脚本)的时候,需要设置执行权限
执行命令: set-ExecutionPolicy RemoteSigned #远程签名
#Set-ExecutionPolicy Restricted #不允许执行(默认选项)
#Set-ExecutionPolicy Unrestricted #无限制
#参数 -Scope CurrentUser 仅当前用户有效
-----------------------------------------------------------------
Get-ExecutionPolicy
Get-ExecutionPolicy -Scope CurrentUser边栏推荐
- CentOS7上Redis安装
- 07 personal R & D products and promotion - human resources information management system
- Flink源码解读(一):StreamGraph源码解读
- C# WinForm中DataGridView单元格显示图片
- [ciscn 2021 South China]rsa writeup
- Final review of information and network security (full version)
- Some feelings of brushing leetcode 300+ questions
- 03个人研发的产品及推广-计划服务配置器V3.0
- Final review of information and network security (based on the key points given by the teacher)
- Learn the wisdom of investment Masters
猜你喜欢
随机推荐
EasyRE WriteUp
Final review of information and network security (full version)
微信防撤回是怎么实现的?
03个人研发的产品及推广-计划服务配置器V3.0
C# WinForm中DataGridView单元格显示图片
TCP's three handshakes and four waves
mysql 基本增删改查SQL语句
Instructions for Redux
Use of mongodb in node
[reverse primary] Unique
Assembly language segment definition
Flink 解析(二):反压机制解析
ByteDance overseas technical team won the championship again: HD video coding has won the first place in 17 items
吴军三部曲见识(七) 商业的本质
Login to verify the simple use of KOA passport Middleware
Redis quick start
Compile homework after class
SQL调优小记
灵活报表v1.0(简单版)
JVM garbage collector part 2








