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

通过Expo安装React Native时遭遇npm E404错误求助

解决Expo安装React Native时的npm E404错误

npm ERR! code E404
npm ERR! 404 Not Found - GET https://skimdb.npmjs.com/registry/create-expo-app/-/create-expo-app-2.1.1.tgz - not_found
npm ERR! 404
npm ERR! 404 'create-expo-app@https://skimdb.npmjs.com/registry/create-expo-app/-/create-expo-app-2.1.1.tgz' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

这个错误的核心原因是你的npm当前指向的registry是skimdb.npmjs.com,这个源已经无法正常提供create-expo-app@2.1.1的包资源,需要切换到官方npm源。

解决步骤:

  1. 先检查当前npm registry配置:

    npm config get registry
    

    如果返回的是https://skimdb.npmjs.com/registry/,说明确实是源的问题。

  2. 将npm registry切换为官方源:

    npm config set registry https://registry.npmjs.org/
    
  3. 清空npm缓存,避免残留的错误缓存影响安装:

    npm cache clean --force
    
  4. 重新执行Expo项目创建命令,推荐使用latest标签获取最新版本,避免指定旧版本出现找不到的情况:

    npx create-expo-app@latest 你的项目名称
    

临时方案(不想修改全局配置的话)

可以在安装时临时指定官方源:

npx --registry https://registry.npmjs.org create-expo-app@latest 你的项目名称

如果你使用Yarn

同样检查并修改Yarn的registry:

yarn config get registry
yarn config set registry https://registry.npmjs.org/

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.29 02:47:13