VSC PowerShell.在npm更新包之后,无法加载.ps1包,因为此系统上的运行脚本已被禁用 [英] VSC PowerShell. After npm updating packages .ps1 cannot be loaded because running scripts is disabled on this system

查看:45
本文介绍了VSC PowerShell.在npm更新包之后,无法加载.ps1包,因为此系统上的运行脚本已被禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VSC中设计网站,而PowerShell是我的默认终端.

I design websites in VSC and PowerShell is my default terminal.

在较早地将网站更新和部署到firebase之后,系统提示我更新firebase工具-我使用npm进行了操作.在出现以下错误之后,我无法立即运行/访问任何firebase脚本:

After updating and deploying a website to firebase earlier, I was prompted to update firebase tools - which I did using npm. Immediately after I cannot run/access any firebase scripts wthout the folllowing error:

firebase:无法加载文件C:\ Users \ mada7 \ AppData \ Roaming \ npm \ firebase.ps1,因为此系统上禁用了运行脚本.有关更多信息,请参阅https://go.microsoft.com/fwlink/?LinkID=135170上的about_Execution_Policies.在第1行:char:1

firebase+ CategoryInfo:SecurityError:(:) [],PSSecurityException+ FullyQualifiedErrorId:UnauthorizedAccess

我花了几个小时四处搜寻,但找不到可靠的答案.许多线程已经使用了好几年了,我觉得很奇怪,在过去的一年中直到今天我都没有遇到过这个问题.如果将默认终端设置为cmd,我仍然可以访问firebase脚本.

I've spent a few hours searching around and can't find a solid answer the problem. Many threads are several years old and I find it bizarre I've not had this problem in the past year until today. I can still access firebase scripts if I set my default terminal to cmd.

假设问题与我一直在使用的firebase-tools有关,但是现在更新了vue.js并在尝试在Powershell中运行任何vue命令时再次出现错误:

Assuming the problem was related to firebase-tools I've carried on working but have now updated vue.js and get the error again when trying to run any vue commands in powershell:

vue:无法加载文件C:\ Users \ mada7 \ AppData \ Roaming \ npm \ vue.ps1,因为此系统上的运行脚本已禁用.有关更多信息,请参阅https://go.microsoft.com/fwlink/?LinkID=135170上的about_Execution_Policies.在第1行:char:1

vue+ CategoryInfo:SecurityError:(:) [],PSSecurityException+ FullyQualifiedErrorId:UnauthorizedAccess

VSCode版本:版本:1.37.1(用户设置)提交:f06011a日期:2019-08-15T16:17:55.855Z电子:4.2.7铬:69.0.3497.128Node.js:10.11.0V8:6.9.427.31-electron.0操作系统:Windows_NT x64 10.0.18362操作系统版本:Windows 10家庭版版本-1903操作系统内部版本-18362.295

我一直在阅读,并看到许多关于脚本权限的线程,但是我没有做任何改变-实际上,PowerShell脚本在更新软件包之前一直有效.在此期间,未触及其他设置.我不想不必要地更改PowerShell设置.

I've been reading around and seen many threads around permissions for scripts, but I haven't changed any - indeed the PowerShell scripts worked right up until I updated my packages. No other settings touched in the mean time. I don't want to be changing PowerShell settings unnecessarily.

推荐答案

只需删除 firebase.ps1 文件:

文件 C:\ Users \<您的帐户> \ AppData \ Roaming \ npm \ firebase.ps1

这篇关于VSC PowerShell.在npm更新包之后,无法加载.ps1包,因为此系统上的运行脚本已被禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆