React-native-fs: Could not resolve dependency: peer react-native@"^0.59.5" from [email protected]

Created on 13 Apr 2021  路  8Comments  路  Source: itinance/react-native-fs

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"
  }
discussion

Most helpful comment

I submitted a PR #1001 馃憤

All 8 comments

I think peerDependencies should be removed from package.json

Facing the same problem

Same issue

I think peerDependencies should 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-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)

Try Reinstalling NPM globally.
npm i -g npm

This should solve the error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PimDeWitte picture PimDeWitte  路  4Comments

MuppaAkhil picture MuppaAkhil  路  3Comments

wmonecke picture wmonecke  路  3Comments

crobinson42 picture crobinson42  路  4Comments

let-aurn picture let-aurn  路  3Comments