gpt4 book ai didi

javascript - Nodemon 命令不工作未经授权的访问

转载 作者:行者123 更新时间:2023-12-01 21:24:53 24 4
gpt4 key购买 nike

我正在尝试运行 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

如果机器返回“Restricted”

  • 键入Set-ExecutionPolicy Unrestrict并按Enter
  • 按:y

现在转到您的终端并再次尝试 nodemon

关于javascript - Nodemon 命令不工作未经授权的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63211819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com