惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
L
LangChain Blog
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Full Disclosure
T
The Blog of Author Tim Ferriss
月光博客
月光博客
有赞技术团队
有赞技术团队
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
博客园 - Franky
B
Blog
博客园_首页
C
CERT Recently Published Vulnerability Notes
Hugging Face - Blog
Hugging Face - Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
Kaspersky official blog
I
Intezer
P
Proofpoint News Feed
博客园 - 叶小钗
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
Recorded Future
Recorded Future
NISL@THU
NISL@THU
A
Arctic Wolf
Know Your Adversary
Know Your Adversary
C
Cyber Attacks, Cyber Crime and Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
Forbes - Security
Forbes - Security
Project Zero
Project Zero
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cisco Talos Blog
Cisco Talos Blog
D
Docker
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理

博客园 - emanlee

ubuntu 设置北京日期时间 mysql 在新电脑上导入,出现错误:ERROR at line 4019: Unknown command '\''. - emanlee 安装 yarn VS code, 最近打开过哪些项目或文件夹,把这些备份下来,到另外一台电脑上恢复 傲梅分区助手 【好用】 ubuntu 可以使用Windows远程桌面连接吗?【可以】 把xshell的全部连接和密码,从一台Windows 10电脑,迁移到Windows11电脑。 Windows 远程桌面(mstsc)完整迁移方案(含历史连接记录、RDP 配置、保存的账号密码)【可行】 Endnote,如何能完整迁移库和模版 ubuntu 安装 locate “华为杯”第八届中国研究生人工智能创新大赛 当数据量很大时,执行 mysql> source filename.sql 很慢,有什么办法更快 pip install django-ranged-response==0.2.0 部署Vue+Django 04c,mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory Ubuntu Server 24.04 安装 MySQL, ./mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory ubuntu server 24.04: 如何设置默认采用 Xorg 方式登录 Ubuntu Server 24.04 设置锁屏时间 Ubuntu Server 启动过程中,比较慢 Job systemd-networkd-wait-online.service/start running Ubuntu Server 24.04 启用root用户 Ubuntu snap install 安装todesk是否必须检查 CPU 是否支持 AVX / AVX2 命令 Ubuntu Server 24.04下解决SunloginClient 向日葵依赖libgconf-2-4安装问题 Ubuntu Server 24.04 安装图形界面 ubuntu server 24.04 安装 中文输入法 Ubuntu Server 24.04 安装浏览器firefox Ubuntu Server 24.04 安装todesk【先联网,CPU必须支持 AVX / AVX2 】 Ubuntu Server 24.04 安装中文,汉字 Python赋值,什么时候传引用? 大驼峰命名法 python 容易理解类和对象的例子 django+mysql: 如何添加一个新的超级用户?
npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚本。 - emanlee
emanlee · 2026-07-04 · via 博客园 - emanlee

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

报错原因

Windows PowerShell 默认执行策略是 Restricted,禁止运行 .ps1 脚本,而输入 npm 时会调用 npm.ps1,直接被拦截。

方案 1:永久修复(推荐,开发电脑用)【可用,可行

步骤 1:管理员身份打开终端

  1. Windows 搜索框输入 终端 / PowerShell
  2. 右键 → 以管理员身份运行

步骤 2:执行这条安全命令(只作用当前用户)

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force
  • RemoteSigned:本地脚本随便跑,网上下载的脚本需要签名,兼顾安全与开发
  • -Scope CurrentUser:仅当前账号生效,不用改整机权限
  • -Force:跳过确认弹窗

步骤 3:关闭所有 VS Code/PowerShell 窗口,重新打开再用 npm 即可

方案 2:不想改系统策略,临时绕过(一次性)

Set-ExecutionPolicy Bypass -Scope Process -Force

方案 3:最简单偷懒方案(不用改权限)

  1. 终端右上角下拉箭头 → 选择「命令提示符」
  2. CMD 下直接用 npm,不会报这个脚本限制错误

验证是否修复

补充:恢复默认策略(需要时)

Set-ExecutionPolicy -Scope CurrentUser Restricted -Force