React-native-router-flux: 正在安装 react-native 的重复版本

创建于 2017-04-20  ·  40评论  ·  资料来源: aksonov/react-native-router-flux

react-native-router-flux v3.38.1
反应原生 v0.42.3

yarn install 导致安装 react-native v0.42.3 和 react-native v0.41.1

应该将 react 和 react-native 安装为 react-native-router-flux 的 peerDependency 吗?

重现:

react-native init {projectName} --version=0.42.3
cd {项目名称}
yarn add react-native-router-flux
npm 开始

你应该看到

Failed to build DependencyGraph: <strong i="15">@providesModule</strong> naming collision:
  Duplicate module name: react-animated
  Paths: /Users/bdewitt/sandbox/break/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Animated/release/package.json collides with /Users/bdewitt/sandbox/break/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by a <strong i="16">@providesModule</strong> declaration with the same name across two different files.
Error: <strong i="17">@providesModule</strong> naming collision:
  Duplicate module name: react-animated
  Paths: /Users/bdewitt/sandbox/break/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Animated/release/package.json collides with /Users/bdewitt/sandbox/break/node_modules/react-native/Libraries/Animated/release/package.json

This error is caused by a <strong i="18">@providesModule</strong> declaration with the same name across two different files.
    at HasteMap._updateHasteMap (/Users/bdewitt/sandbox/break/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
    at p.getName.then.name (/Users/bdewitt/sandbox/break/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:133:31)

纱线添加[email protected]

应该成功

最有用的评论

也被这个弄坏了。 修复了回滚到 3.38.0

watchman watch-del-all
rm -rf node_modules && npm install
npm uninstall react-native-router-flux
npm install --save [email protected]
rm -fr $TMPDIR/react-*
npm cache clean
npm start -- --reset-cache

所有40条评论

来到这里发布相同的问题,看起来它被意外添加到此提交中的依赖项中: https ://github.com/aksonov/react-native-router-flux/commit/34e2d7ac7eb09489c2fd7f19844bd38e27e969fc

我相信它应该被列为 peerDependency

我一直在为这个问题而烦恼,很高兴遇到问题的根源

jest-haste-map: <strong i="6">@providesModule</strong> naming collision:
  Duplicate module name: react-native
  Paths: /Users/${username}/Desktop/${appName}/node_modules/react-native-router-flux/node_modules/react-native/package.json collides with /Users/${username}/Desktop/${appName}/node_modules/react-native/package.json

This warning is caused by a <strong i="7">@providesModule</strong> declaration with the same name across two different files.
Failed to build DependencyGraph: <strong i="8">@providesModule</strong> naming collision:
  Duplicate module name: react-native-vector-icons
  Paths: /Users/${username}/Desktop/${appName}/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/${username}/Desktop/${appName}/node_modules/react-native-router-flux/node_modules/react-native/local-cli/core/__fixtures__/files/package.json

This error is caused by a <strong i="9">@providesModule</strong> declaration with the same name across two different files.
Error: <strong i="10">@providesModule</strong> naming collision:
  Duplicate module name: react-native-vector-icons
  Paths: /Users/${username}/Desktop/${appName}/node_modules/react-native/local-cli/core/__fixtures__/files/package.json collides with /Users/${username}/Desktop/${appName}/node_modules/react-native-router-flux/node_modules/react-native/local-cli/core/__fixtures__/files/package.json

This error is caused by a <strong i="11">@providesModule</strong> declaration with the same name across two different files.
    at HasteMap._updateHasteMap (/Users/${username}/Desktop/${appName}/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:158:13)
    at p.getName.then.name (/Users/${username}/Desktop/${appName}/node_modules/react-native/packager/src/node-haste/DependencyGraph/HasteMap.js:133:31)

从我的 package.json 中删除react-native-router-flux并重新安装 node_modules 不会导致错误,所以它肯定是react-native-router-flux

同样的问题

同在,请更新包

是的,这也毁了我的一天。 作为一种快速解决方法,您可以从 react-native-router-flux 中的 node_modules 文件夹中删除 react-native 的副本。 丑陋,但至少会让你暂时启动并运行

+1

现在重新安装 3.38.0
npm install --save [email protected]

我相信这与纱线无关。 因为即使我使用 npm 安装它,我也会遇到同样的问题。 我删除了我的 node_modules 文件夹并清除了 npm 缓存,但问题仍然存在。 目前,我继续使用我在 GitHub 问题上阅读的解决方法,我必须删除node_modules/react-native-router-flux/node_modules/react-native包。 我希望他们能尽快解决这个问题。

同样在这里

等待修复我回滚到[email protected]

同样在这里

也被这个弄坏了。 修复了回滚到 3.38.0

watchman watch-del-all
rm -rf node_modules && npm install
npm uninstall react-native-router-flux
npm install --save [email protected]
rm -fr $TMPDIR/react-*
npm cache clean
npm start -- --reset-cache

我也一样,必须手动删除 react-native-router-flux 中的 react-native 目录才能正常工作。

是的,手动回滚或删除文件夹,感谢您的解决方法

希望问题在下一个版本中得到解决。

同样的问题,请帮忙解决

回滚到 3.38.0 为我解决了这个问题,非常感谢大家!

同样在这里,回到 3.38.0 修复它。 谢谢!

+1

谢谢!

我去准备香槟!

同样的问题,解决回滚到 3.38.0

回滚到v0.38.0或仅删除react-native-router-flux/node_modules/中的 react-native 文件夹,并删除react-native-router-flux/node_modules/.bin/中的 react-native 符号链接现在。

贴出以上内容方便复制粘贴😄

watchman watch-del-all && rm -rf node_modules && npm install && npm uninstall react-native-router-flux && npm install --save [email protected] && rm -fr $TMPDIR/react-* && npm cache clean && npm start -- --reset-cache 

刚刚卡住了,谢谢

+1

对我有用的是这个序列:

守望者手表德尔所有
rm -rf node_modules && npm install
npm 卸载 react-native-router-flux
npm install --save [email protected]
rm -fr $TMPDIR/react-*
npm 缓存清理
npm install --save [email protected]
npm start -- --reset-cache

尝试了上述所有步骤,错误消失了,但路由器没有,场景也没有渲染组件。 仔细检查它们是否被正确提取并且它们是 . 不知道为什么

尝试了命令行的修复,这使我的构建工作没有错误,但是当我开玩笑地运行我的单元测试时,它抱怨它在 react-native-router-flux 文件夹中找不到 node_module 文件夹。 看起来 jest 仍在引用这些文件夹:(
有谁知道 Jest 引用的这个来自哪里?
ENOENT: no such file or directory, stat '/{projectDirectory}/node_modules/react-native-router-flux/node_modules/react-native/Libraries/Core/ErrorUtils.js

@geecurve得到了同样的错误,没有npm cache cleanyarn cache clean ,甚至rm -rf node_modules都能正常工作。 我发现原来的项目目录已经死了,所以用小盒子创建了一个新目录。 执行yarn install并且项目已准备好构建和测试。

@prtkkmrsngh您是否删除了 /node_modules/react-native-router-flux 中的 react-native 文件夹? 还是恢复为react-native-router-flux 3.38.0

@MattyK14恢复到 3.38.0 并将 RN 升级到 0.44

请问各位,
如何解决这个错误?

image

[email protected]
├── 罗达什。 [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
└──[email protected]
└── [email protected]

@nazaslater将您的版本修复为“react-native-router-flux”:“3.38.0”,您拥有 3.38.1

谢谢@Tonacatecuhtli

已经一个月了,有没有机会做出可以结束这个错误的微小修复?

@aksonov请解决问题。 3.39.2

😥

@abdurrahmanekr @asokol我们可以将它发布到 npm 它仍然显示 3.39.1 作为最新的https://www.npmjs.com/package/react-native-router-flux

现在是 3.39.2

此页面是否有帮助?
0 / 5 - 0 等级