You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装nodemon时出现code1命令失败错误,求解决方案

问题

执行npm i nodemon -D命令时安装失败,相关报错可参考对应截图(无法外链展示)。已尝试删除package.json、移除node_modules后重新安装,且试过多种方案,问题仍未解决。

可行排查方案
  • 清理npm缓存后重试:
    npm cache clean --force
    npm i nodemon -D
    
  • 以权限提升方式执行命令:
    • Windows:右键终端选择「以管理员身份运行」后再执行安装命令
    • Linux/macOS:
      sudo npm i nodemon -D
      
  • 切换npm镜像源(比如国内淘宝镜像):
    临时切换执行:
    npm i nodemon -D --registry=https://registry.npmmirror.com
    
    或永久设置镜像源后重试:
    npm config set registry https://registry.npmmirror.com
    npm i nodemon -D
    
  • 检查Node.js和npm版本兼容性,尝试升级到稳定版后重新安装
  • 确认网络连接正常,若处于受限网络环境,尝试切换网络或配置代理

内容的提问来源于stack exchange,提问作者Mehwish Sameer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 10:48:19