React native React native packager在节点6.5上失败

React native React native packager在节点6.5上失败,react-native,React Native,这是以前的工作。但是,由于我从节点4.6升级到了节点6.5,所以当我执行npm启动时,我最终会出现以下错误 Failed to build DependencyGraph: @providesModule naming collision: Duplicate module name: String.prototype.es6 Paths: ...../node_modules/react-native/packager/react-packager/src/Resolver/polyf

这是以前的工作。但是,由于我从节点4.6升级到了节点6.5,所以当我执行
npm启动时
,我最终会出现以下错误

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: ...../node_modules/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js collides with ...../app/MallJell/nd/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: ....../react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js collides with ..../react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name across two different files.
    at HasteMap._updateHasteMap (..../node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:155:13)
    at module.getName.then.name (.....node_modules/react-native/packager/react-packager/src/node-haste/DependencyGraph/HasteMap.js:115:31)

我只是把对你有用的答案放在这里,让其他人可以看到。

删除node_modules文件夹

rm -rf node_modules/
然后清理npm缓存并重新安装模块

npm cache clean && npm install
然后再次运行打包机

npm start

我通过修改“packag.json”的代码来解决这个问题,然后重新安装NodeModule

之前:

"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
},

"scripts": {
       "start": "react-native start"
},

在更新节点之后,是否尝试更新节点\ U模块。。。?npm Install您最近是否升级了React本机或将某些文件从某个位置复制到React本机目录?考虑消息<代码>重复模块名称:Strord.PotoTyr.E66/COD> @ AbdulaAd:我完全删除了NoDeNoMax模块,然后运行<代码> NPM安装< /COD> >其次是代码> NPM启动< /代码> @ EFKAN:所有代码都是Git存储库的一部分。只需重新签出,然后上述步骤就会导致错误。我只升级了
节点
npm
。我的RN已经达到了0.32。感谢您的回复,当我刚刚尝试这个刷新(删除节点_模块)和npm缓存清理时,我看到它正在工作。我有完全相同的问题。但上述解决方案对我不起作用。有什么帮助吗?在运行上述命令后,您是否有相同的错误,或者错误是否发生了变化?我有相同的错误。以上步骤没有区别