【发布时间】:2019-07-02 18:34:42
【问题描述】:
React Native Expo 用户!
我在使用 react-navigation(空白和标签)的 expo init 上遇到错误:
npm ERR! 404 '@react-navigation/native@3.1.4' is not in the npm registry.
几个月来我一直在使用 Expo 进行 React Native 开发,并且在学习和解决错误的过程中取得了巨大的成功!
我放了个假,回来开始一个新项目,用 react-navigation@^3.0.0 碰壁 - 我尝试了很多解决方案,但没有工作。
我正在使用 expo 和 npm 启动一个新项目,选项卡和空白模板都有 react-navigation npm install 问题:
expo init
? Choose a template: expo-template-tabs
? Choose which workflow to use: managed
✔ Please enter a few initial configuration values.
Read more: https://docs.expo.io/versions/latest/workflow/configuration · 100% completed
? Yarn v1.13.0 found. Use Yarn to install dependencies? No
[08:18:30] Extracting project files...
[08:18:31] Customizing project...
[08:18:31] Initialized a git repository.
[08:18:31] Installing dependencies...
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@react-navigation%2fnative - Not Found
npm ERR! 404
npm ERR! 404 '@react-navigation/native@3.1.4' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404 1. name can only contain URL-friendly characters
npm ERR! 404 It was specified as a dependency of 'react-navigation'
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 ERR! A complete log of this run can be found in:
npm ERR! /Users/ddcjosiahl/.npm/_logs/2019-02-08T13_18_47_333Z-debug.log
[08:18:47] Process exited with non-zero code: 1
[08:18:47] Set EXPO_DEBUG=true in your env to view the stack trace.
我正在尝试没有运气的选项:
已清除 NPM 缓存
试纱
再次安装expo cli
-
npm install --save react-navigation ... react-native、native等
npm install --save react-navigation npm 错误!代码 E404 npm 错误! 404 未找到:@react-navigation/native@3.1.4
- 注意:昨天我花了一整天的时间试图让新项目开始工作。我确实设法通过安装不同版本的 react-native 来通过它,并且无法复制......然后导致版本不匹配并且应用程序无法加载:*
****RNGestureHandlerButton:**** enter image description here
为什么 react-navigation@^3.0.0 需要 native@3.1.4 以及如何解决?
谢谢!
【问题讨论】:
标签: reactjs react-native native react-navigation expo