React Native Application尚未注册{[React native]}

时间:2018-09-12 09:47:01

标签: javascript

我也遇到同样的问题,并且正在使用:

{
  "dependencies": {
    "react": "16.4.1",
    "react-native": "0.55.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "babel-preset-react-native": "5.0.2",
    "jest": "23.6.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

有人可以提出有关此问题的任何解决方案吗?我已经在此问题上花了2天的时间,但这似乎无济于事。

1 个答案:

答案 0 :(得分:0)

我找到了解决此问题的方法,这是package.json文件,它将大大帮助您,将文件粘贴到项目目录中后,转到cmd并编写npn install

{   “ name”:“ Test2”,   “ version”:“ 0.0.1”,   “私人”:是的,   “脚本”:{     “ start”:“节点node_modules / react-native / local-cli / cli.js开始”,     “ test”:“开玩笑”   },   “依赖关系”:{     “ react”:“ ^ 16.3.0-alpha.1”,     “本机”:“ 0.54.4”   },   “ devDependencies”:{     “ babel-jest”:“ 23.6.0”,     “ babel-preset-react-native”:“ ^ 4.0.1”,     “ jest”:“ 23.6.0”,     “ react-test-renderer”:“ 16.5.0”   },   “笑话”:{     “ preset”:“ react-native”   } }