当前位置:网站首页>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边栏推荐
猜你喜欢
随机推荐
C#WinForm中的dataGridView滚动条定位
轻量级计划服务工具研发与实践
[VNCTF 2022]ezmath wp
vscode
Only learning C can live up to expectations top2 P1 variable
05 personal R & D products and promotion - data synchronization tool
关于Selenium启动Chrome浏览器闪退问题
mysql高級(索引,視圖,存儲過程,函數,修改密碼)
关于Stream和Map的巧用
Flink 解析(五):State与State Backend
Models used in data warehouse modeling and layered introduction
1. Introduction to JVM
DOS function call
肖申克的救赎有感
复盘网鼎杯Re-Signal Writeup
Wu Jun trilogy insight (IV) everyone's wisdom
Total / statistics function of MySQL
MySQL Advanced (index, view, stored procedures, functions, Change password)
Junit单元测试
mysql 基本增删改查SQL语句







![Case: check the empty field [annotation + reflection + custom exception]](/img/50/47cb40e6236a0ba34362cdbf883205.png)

