与create-react-native-app的依赖关系

时间:2018-05-13 15:32:08

标签: react-native dependencies create-react-native-app

我得到了一个新的错误列表,如下所示:

npm ERR! peer dep missing: react@16.3.1, required by react-native@0.55.4
npm ERR! extraneous: websql@0.4.4 d:\atestbed\native-react\lecture4-contacts\node_modules\websql
npm ERR! missing: websql@https://github.com/expo/node-websql/archive/18.0.0.tar.gz, required by expo@27.0.1
npm ERR! peer dep missing: react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, required by react-native-maps@0.21.0
npm ERR! peer dep missing: eslint@^3.17.0 || ^4.0.0, required by eslint-plugin-react-native@3.2.1

当我尝试安装这些依赖项时,我似乎使问题变得更糟。这是否会在以后的更新中自行解决,或者我现在需要解决这些问题吗?非常感谢任何指导

更新:

我删除了纱线和create-react-native-app并重新安装,再次使用-g选项。然后我更新了对16.3.1的反应,但得到了大约50个丢失的文件警告。我更新到16.3.2,但这不适用于世博会。重新安装react.16.3.1,现在丢失的文件更少。

然后我安装了丢失的软件包,但npm ls剧照说它们丢失了:

npm ERR! peer dep missing: react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, 
required by react-native-maps@0.21.0
npm ERR! missing: mkdirp@0.5.1, required by node-pre-gyp@0.10.0
npm ERR! missing: minimist@0.0.8, required by mkdirp@0.5.1
npm ERR! missing: safe-buffer@5.1.1, required by readable-stream@2.3.6
npm ERR! missing: safe-buffer@5.1.1, required by string_decoder@1.1.1
npm ERR! missing: string-width@1.0.2, required by gauge@2.7.4
npm ERR! missing: strip-ansi@3.0.1, required by gauge@2.7.4
npm ERR! missing: strip-ansi@3.0.1, required by string-width@1.0.2
npm ERR! missing: ansi-regex@2.1.1, required by strip-ansi@3.0.1
npm ERR! missing: string-width@1.0.2, required by wide-align@1.1.2
npm ERR! missing: once@1.4.0, required by glob@7.1.2
npm ERR! missing: once@1.4.0, required by inflight@1.0.6
npm ERR! missing: wrappy@1.0.2, required by inflight@1.0.6
npm ERR! missing: wrappy@1.0.2, required by once@1.4.0
npm ERR! missing: minipass@2.2.4, required by tar@4.4.1
npm ERR! missing: mkdirp@0.5.1, required by tar@4.4.1
npm ERR! missing: safe-buffer@5.1.1, required by tar@4.4.1
npm ERR! missing: yallist@3.0.2, required by tar@4.4.1
npm ERR! missing: minipass@2.2.4, required by fs-minipass@1.2.5
npm ERR! missing: safe-buffer@5.1.1, required by minipass@2.2.4
npm ERR! missing: yallist@3.0.2, required by minipass@2.2.4
npm ERR! missing: minipass@2.2.4, required by minizlib@1.1.0

2 个答案:

答案 0 :(得分:0)

由于某种原因,安装的版本与react-native所需的版本不匹配。

我通过删除yarn.locknode_modules并再次运行yarn来重新安装deps来解决此问题。

我不确定导致此问题的原因是什么,package.json在依赖项中列出了正确的版本,但我认为安装的版本是最新的(yarn.lock问题?不确定... )

我认为他们的回购中的这个问题是相关的:https://github.com/react-community/create-react-native-app/issues/649

答案 1 :(得分:0)

这似乎有用:

  1. 卸下纱线(可能没有必要)
  2. 将npm回滚到版本4.6.1
  3. 安装eslint@4.0.0
  4. 安装ajv@6.0.0
  5. 将安装添加到json文件以隐藏无关警告
  6. 现在唯一应该留下的错误是:

    npm ERR! peer dep missing: react-native@^0.51 || ^0.52 || ^0.53 || ^0.54, required by react-native-maps@0.21.0
    

    这是用于处理地图而不是js功能地图的react-native-maps包的问题