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

运行npx create-next-app@latest遇registry网络错误,求解决方案

解决npx create-next-app@latest的registry网络错误

报错信息:

npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network 请求https://registry.npmjs.org/create-next-app失败,原因:getaddrinfo ENOTFOUND host
npm ERR! network 这是网络连接相关问题。
npm ERR! network 大多数情况是处于代理环境或网络设置有误。
npm ERR! network
npm ERR! network 若处于代理环境,请确保'proxy'配置正确。参考:'npm help config'

解决步骤:

  • 检查基础网络:确认设备能正常访问网络,尝试访问https://registry.npmjs.org,若无法访问,切换网络(如手机热点)后重试。
  • 重置npm代理配置:执行以下命令清理错误的代理设置:
    npm config delete proxy
    npm config delete https-proxy
    
    之后可设置官方源或国内镜像源:
    # 官方源
    npm config set registry https://registry.npmjs.org/
    # 国内淘宝镜像源(推荐网络不佳时使用)
    npm config set registry https://registry.npmmirror.com/
    
  • 关闭全局代理:暂停系统中的VPN、代理软件等,避免代理干扰npm的网络请求。
  • 清理npm缓存:执行命令清理缓存后重新创建项目:
    npm cache clean --force
    npx create-next-app@latest
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.28 12:02:41