I\'m using a local module in package.json
that also has react-native
as a dependency.
In my APP package.json
:
I also got the same error. I tried below steps, its works like a charming.
Please remove all react-native specific folders from "%appdata%\Temp" and then try below commands:
rimraf node_modules
npm cache clean --force
npm install
rm -rf ios/build
Change /Users/Jebasuthan/XcodeProject/Game/ios/Pods/React/package.json
to something else
non recursive
Faced same issue Resolved it !!
All the npm packages in project have node modules. Make sure that node_modules directory inside packages should not include already present node module.
In my case react-native
was present in node_modules of my project as well as node_modules of another forked library.
As the library was forked, I could remove node_modules directory from it and the issue got resolved.
const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
resolver: {
blacklistRE: blacklist([
/node_modules\/.*\/node_modules\/react-native\/.*/,
])
},
};
watchman watch-del-all
rm -rf node_modules && npm install
rm -fr $TMPDIR/react-*
npm cache clean
npm start -- --reset-cache
for more check out here
I respond myself.
As a temporary solution, and given putting the dependencies in peerDependencies
didn't work either, I've put the react
and react-native
in devDependencies
of the react-native-services
package.