如何在js中运行nodemon而不出错

问题描述 投票:0回答:1

它给了我这个错误

nodemon:文件 C:\Users\sky_cairo\AppData\Roaming 下午 odemon.ps1 不能 已加载,因为在此系统上禁用运行脚本。 有关详细信息,请参阅 about_Execution_Policies,网址为 https://go.microsoft.com/fwlink/?LinkID=135170。 在行:1 字符:1

  • nodemon afaf.js
  •   + CategoryInfo          : SecurityError: (:) [], PSSecur
    ityException
      + FullyQualifiedErrorId : UnauthorizedAccess
    
    

我尝试 npm 我的nodemon 给我这个 截至目前,1秒内审核了34个包

3 个套餐正在寻求资金 运行

npm fund
了解详情

发现0个漏洞 PS C:\Users\sky_cairo\OneDrive\Desktop faf.js> 然后我写nodemon afaf.js adg 给我上面的错误

nodemon
1个回答
0
投票

在 package.json 中,在脚本中添加以下内容:

"scripts" : {
    "dev" : "nodemon ./afaf.js"
}

然后在终端中,运行:而不是nodemon afaf.js:

npm run dev
© www.soinside.com 2019 - 2024. All rights reserved.