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

dependencies with 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

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

更新:

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

然后我安装了缺少的包,但是 npm ls stills 说它们丢失了:

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

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

我通过再次删除 yarn.locknode_modules 以及 运行 yarn 来重新安装 deps 来解决这个问题。

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

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

这似乎有效:

  1. 卸载纱线(这可能不是必需的)
  2. 将 npm 回滚到版本 4.6.1
  3. 安装eslint@4.0.0
  4. 安装ajv@6.0.0
  5. 将安装添加到 json 文件以消除无关警告

现在您应该留下的唯一错误是:

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

这是用于处理地图的 react-native-maps 包的问题,​​而不是 js 函数 map