无法解决“反应导航" [英] Unable to resolve 'react-navigation'

查看:50
本文介绍了无法解决“反应导航"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试 react-native 并在我安装并尝试使用 react-navigation 时遇到以下错误(从react-navigation"导入 {StackNavigator};).

Am trying out react-native and get below error, when I install and try to use react-navigation (import {StackNavigator} from 'react-navigation';).

错误

我使用以下命令安装react-navigation":npm install --save react-navigation

I use the following command to install "react-navigation" : npm install --save react-navigation

在运行上面的命令时,我在 node_modules 文件夹下得到 'react-navigation' 文件夹,只有一个文件 (package.json).文件内容如下:

On running above command I get 'react-navigation' folder under node_modules folder, with just a single file (package.json). Below is the content of the file:

{
  "_args": [
    [
      {
        "raw": "react-navigation@0.0.0",
        "scope": null,
        "escapedName": "react-navigation",
        "name": "react-navigation",
        "rawSpec": "0.0.0",
        "spec": "0.0.0",
        "type": "version"
      },
      "/Users/rakesh-1812/Documents/REACT_JS/SimpleApp"
    ]
  ],
  "_from": "react-navigation@0.0.0",
  "_id": "react-navigation@0.0.0",
  "_inCache": true,
  "_location": "/react-navigation",
  "_nodeVersion": "4.2.1",
  "_npmOperationalInternal": {
    "host": "packages-12-west.internal.npmjs.com",
    "tmp": "tmp/react-navigation-0.0.0.tgz_1459892254509_0.1584461957681924"
  },
  "_npmUser": {
    "name": "ericvicenti",
    "email": "ericvicenti@gmail.com"
  },
  "_npmVersion": "2.14.7",
  "_phantomChildren": {},
  "_requested": {
    "raw": "react-navigation@0.0.0",
    "scope": null,
    "escapedName": "react-navigation",
    "name": "react-navigation",
    "rawSpec": "0.0.0",
    "spec": "0.0.0",
    "type": "version"
  },
  "_requiredBy": [
    "#USER",
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-0.0.0.tgz",
  "_shasum": "1e0f865235cdb4d4aa8086484fd3690ff73df553",
  "_shrinkwrap": null,
  "_spec": "react-navigation@0.0.0",
  "_where": "/Users/rakesh-1812/Documents/REACT_JS/SimpleApp",
  "dependencies": {},
  "description": "Coming Soon",
  "devDependencies": {},
  "directories": {},
  "dist": {
    "shasum": "1e0f865235cdb4d4aa8086484fd3690ff73df553",
    "tarball": "https://registry.npmjs.org/react-navigation/-/react-navigation-0.0.0.tgz"
  },
  "maintainers": [
    {
      "name": "ericvicenti",
      "email": "ericvicenti@gmail.com"
    }
  ],
  "name": "react-navigation",
  "optionalDependencies": {},
  "readme": "ERROR: No README data found!",
  "scripts": {},
  "version": "0.0.0"
}

谁能帮我解决这个问题.提前致谢.

Can someone please help me resolve the issue. Thanks in advance.

推荐答案

React 导航仍处于测试阶段.当我使用命令时它对我有用:

React navigation is still in beta. It works for me when I use the command:

npm install --save react-navigation@1.0.0-beta.7 

这是最新版本.https://github.com/react-community/react-navigation/releases

这篇关于无法解决“反应导航"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆