![cover](https://img-blog.csdnimg.cn/direct/881e868c6a5a438ca7bf8aeed9afd4aa.png)
idea 开发工具的terminal终端执行脚本报错,uglifyjs : 无法加载文件 D:\Program Files\nvm\nodejs\uglifyjs.ps1,因为在此系统上禁止运行脚本
·
一、问题场景
在idea开发工具自带的terminal终端运行脚本,比如:uglifyjs translate.js -c -m -o translate.min.js
结果报错:
二、原因分析
产生这个问题的原因是Windows中的PowerShell的执行策略不允许脚本文件运行
三、解决方案
1、在terminal终端,运行 get-ExecutionPolicy,显示Restricted,表示terminal终端禁止运行任何脚本
2、更改PowerShell的执行策略,打开PowerShell终端,并运行 set-ExecutionPolicy RemoteSigned,然后输入 Y 确定
3、重新运行要执行的脚本,成功
更多推荐
所有评论(0)