Реагировать нативный упаковщик не удается на node 6.5
Это работало ранее. Но так как я обновился с node 4.6 до 6.5, когда я делаю npm start
, я получаю ниже ошибку
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)
Ответы
Ответ 1
Я просто помещаю ответ, который работал для вас здесь, чтобы другие могли его видеть.
Удалите папку node_modules
rm -rf node_modules/
Затем очистите кэш npm и установите модули обратно
npm cache clean && npm install
Затем снова запустите упаковщик
npm start
Ответ 2
Я решаю эту проблему, изменяя код "packag.json". Затем переустанавливаем nodemodules.
До:
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
После
"scripts": {
"start": "react-native start"
},