Eric小屋

  • nodemon 报错问题
  • 1. npm下载过慢:更改镜像
  • 国内npm源镜像(npm加速下载)
  • 2. npm报错 系统上禁止运行脚本
  • 首页
  • 学习笔记
    • JAVA
    • Spring
    • Node.js
    • Vue
  • 学习文档
  • 案例项目
  • 课程笔记
  • 问题解决
登录

nodemon 报错问题

  • Eric
  • 2023-12-14
  • 0

nodemon 报错问题

今天学习nodemon时遇到了三个问题。

1. npm下载过慢:更改镜像

国内npm源镜像(npm加速下载)

使用淘宝镜像源加速 NPM

最新的:

 npm config set registry https://registry.npmmirror.com

之前的:

 npm config set registry https://registry.npm.taobao.org

使用阿里云镜像源加速 NPM

npm config set registry https://npm.aliyun.com

使用腾讯云镜像源加速 NPM

npm config set registry http://mirrors.cloud.tencent.com/npm/

使用华为云镜像源加速 NPM

npm config set registry https://mirrors.huaweicloud.com/repository/npm/

返回npm官方原始镜像

npm config set registry https://registry.npmjs.org/

使用那个镜像,只需要 npm config set registry + 对应的镜像网址就好了

npm config set registry 

查看当前的镜像源:npm config get registry

npm config get registry

2. npm报错 系统上禁止运行脚本

报错:

nodem
nodemon : File C:\Users\MI\AppData\R
ipts is disabled on this system. For
o.microsoft.com/fwlink/?LinkID=13517
At line:1 char:1
+ nodemon server.js
+ ~~~~~~~
    + FullyQualifiedErrorId : Unauth

是因为自己的电脑禁止运行该脚本

解决方法步骤:

  1. win+R 打开 powershell
  1. 权限转到管理员权限
  1. 输入更改 PowerShell 脚本的执行策略指令 set-ExecutionPolicy RemoteSigned

    输入 Y 表示同意

  1. 重新运行nodemon指令 ,发现运行成功
联系作者:2572976830@qq.com
© 2025 Eric小屋
Theme by Wing
京ICP备2023032157号 京公网安备11011402053616号
  • {{ item.name }}
  • {{ item.name }}