簡體   English   中英

Nodemon 命令不起作用 未經授權的訪問

[英]Nodemon Command Not Working Unauthorized Access

我正在嘗試運行 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

我試過卸載它並重新安裝它, npm install -g nodemonnpm install nodemon --save-dev

我有同樣的問題,要解決這個問題:

  • 在管理模式下打開 Windows PowerShell
  • 鍵入Get-ExecutionPolicy並按Enter

如果機器返回“受限”

  • 鍵入Set-ExecutionPolicy Unrestrict並按Enter
  • 按: y

現在 go 到您的終端並再次嘗試nodemon

鍵入Get-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser ,它將Get-ExecutionPolicy更改為RemoteSigned並允許您運行 Nodemon。

嘗試通過 cmd ZDFFF0A7FA1A55C8C1A4966C19ISEF6DA45_2Z => PowerShell_ISE打開 Windows powerShell

在 Powershell 中鍵入此 PowerShell => Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser單擊yes

然后嘗試再次打開你的nodemon ,它應該運行良好祝你好運

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM