当前位置:网站首页>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边栏推荐
猜你喜欢

Learn the wisdom of investment Masters

07 personal R & D products and promotion - human resources information management system

JVM garbage collector part 1

06 products and promotion developed by individuals - code statistical tools

Koa Middleware

轻量级计划服务工具研发与实践

Final review of information and network security (full version)

1. JVM入门介绍

03 products and promotion developed by individuals - plan service configurator v3.0

关于Selenium启动Chrome浏览器闪退问题
随机推荐
JVM 垃圾回收器之Serial SerialOld ParNew
Wu Jun's trilogy insight (V) refusing fake workers
Flink 解析(四):恢复机制
MySQL报错解决
關於Stream和Map的巧用
[reverse primary] Unique
02 personal developed products and promotion - SMS platform
Redis快速入门
轻量级计划服务工具研发与实践
EasyRE WriteUp
信息与网络安全期末复习(基于老师给的重点)
Deploy flask project based on LNMP
1. JVM入门介绍
Von Neumann architecture
mysql的合计/统计函数
Activiti directory (IV) inquiry agency / done, approved
03 products and promotion developed by individuals - plan service configurator v3.0
[mmdetection] solves the installation problem
List set data removal (list.sublist.clear)
【逆向】脱壳后修复IAT并关闭ASLR