Because the react-native version specified in package.json, when you try npm i with npm version 7.* you get following error because not using specified react-native version. There is a workaround which is using npm i --legacy-peer-deps.
Could not resolve dependency:
npm ERR! peer react-native@"^0.59.5" from [email protected]
package.json:
"peerDependencies": {
"react-native": "^0.59.5",
"react-native-windows": "^0.57.2"
}
I think peerDependencies should be removed from package.json
Facing the same problem
Same issue
I think
peerDependenciesshould be removed from package.json
do you want to submit a PR? Thx :)
(Or someone else?)
I submitted a PR #1001 馃憤
Same issue here,
npm ERR! Found: [email protected]
npm ERR! node_modules/react-native
npm ERR! react-native@"^0.63.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native@"^0.59.5" from [email protected]
npm ERR! node_modules/react-native-fs
npm ERR! react-native-fs@"^2.17.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
The workaround submitted does not seem to work here.
I tested :
npm install react-native-fs --legacy-peer-deps
And I got :
npm ERR! subset is not a function
/home/user/.npm/_logs/2021-05-02T09_01_39_772Z-debug.log
53 verbose stack TypeError: subset is not a function
53 verbose stack at Arborist.[saveIdealTree] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:971:37)
53 verbose stack at /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:139:39
53 verbose stack at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:135:5)
53 verbose stack at async Install.install (/usr/lib/node_modules/npm/lib/install.js:137:5)
The workaround submitted does not seem to work here.
I tested :
npm install react-native-fs --legacy-peer-depsAnd I got :
npm ERR! subset is not a function/home/user/.npm/_logs/2021-05-02T09_01_39_772Z-debug.log
53 verbose stack TypeError: subset is not a function 53 verbose stack at Arborist.[saveIdealTree] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:971:37) 53 verbose stack at /usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:139:39 53 verbose stack at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:135:5) 53 verbose stack at async Install.install (/usr/lib/node_modules/npm/lib/install.js:137:5)
Try Reinstalling NPM globally.
npm i -g npm
This should solve the error.
Most helpful comment
I submitted a PR #1001 馃憤