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

推荐订阅源

博客园 - 聂微东
S
Schneier on Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Latest news
Latest news
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
T
Tenable Blog
I
Intezer
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy International News Feed
P
Palo Alto Networks Blog
The Register - Security
The Register - Security
IT之家
IT之家
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
S
Securelist
WordPress大学
WordPress大学
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hugging Face - Blog
Hugging Face - Blog
N
News and Events Feed by Topic
H
Help Net Security
Project Zero
Project Zero
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
L
LINUX DO - 热门话题
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
F
Full Disclosure
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
TaoSecurity Blog
TaoSecurity Blog
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
博客园 - 司徒正美
I
InfoQ
Recent Announcements
Recent Announcements
Attack and Defense Labs
Attack and Defense Labs
P
Privacy & Cybersecurity Law Blog
S
Security @ Cisco Blogs
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
N
Netflix TechBlog - Medium
U
Unit 42
阮一峰的网络日志
阮一峰的网络日志

博客园 - 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: 如何添加一个新的超级用户? Python 异常体系核心:BaseException 及其四大子类 Python 匿名函数(lambda)举例 Python函数内部的局部变量和全局变量 订书钉规格 在Navicat中复制带有自动增长id字段的表格,如何把新表格的自动增长id重新设置为从1开始 科研02 期刊和会议的质量等级 Vue 2,父组件中点击一个按钮,更新子组件(重新加载子组件) 汉明距离(Hamming distance) Modbus slave模拟的从站 如何主动发送数据给主站 Word中,表格中的文字在一行的偏下方,没有垂直居中 在线把汉字转拼音字母 Navicat中复制并修改MySQL表,保存时,出现未知的列的错误 WinSCP 便携版、绿色版 下载 centos / Linux 上,非管理员用户安装 miniconda FTP 服务器设置(FileZilla Server) Windows主机上的Device/Credential Guard功能与VMware Workstation虚拟化冲突导致 Navicat 备份连接
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