[英]Nodemon Command Not Working Unauthorized Access
I'm trying to run nodemon, but when I do, it gives me the following error:我正在尝试运行 nodemon,但是当我这样做时,它给了我以下错误:
nodemon : File C:\Users\dyzha\AppData\Roaming\npm\nodemon.ps1 cannot
be loaded because running scripts is disabled on this system. For
more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ nodemon app.js
+ ~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityExcep
tion
+ FullyQualifiedErrorId : UnauthorizedAccess
I've tried uninstalling it and reinstalling it, npm install -g nodemon
, and npm install nodemon --save-dev
.我试过卸载它并重新安装它,
npm install -g nodemon
和npm install nodemon --save-dev
。
I had the same issue, to resolve this:我有同样的问题,要解决这个问题:
Get-ExecutionPolicy
and press Enter
Get-ExecutionPolicy
并按Enter
If the machine returns "Restricted"如果机器返回“受限”
Set-ExecutionPolicy Unrestrict
and press Enter
Set-ExecutionPolicy Unrestrict
并按Enter
y
y
Now go to your terminal and try nodemon
again.现在 go 到您的终端并再次尝试
nodemon
。
Type Get-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
, it will change the Get-ExecutionPolicy
to RemoteSigned
and allow you to run Nodemon.键入
Get-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
,它将Get-ExecutionPolicy
更改为RemoteSigned
并允许您运行 Nodemon。
Try to open Windows powerShell via cmd cmd => PowerShell_ISE
尝试通过 cmd ZDFFF0A7FA1A55C8C1A4966C19ISEF6DA45_2Z =>
PowerShell_ISE
打开 Windows powerShell
in the Powershell Type this PowerShell => Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
click yes
在 Powershell 中键入此 PowerShell =>
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
单击yes
then try to open your nodemon
again, it should be working well Good luck然后尝试再次打开你的
nodemon
,它应该运行良好祝你好运
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.