Tags
react.js
Asked 2 years ago
20 Jul 2022
Views 1196
Romaine

Romaine posted

React native - Error : Could not resolve dependency

npm install

i tried to install all depedency.
npm install
but some how i getting following error :

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0" from @react-native-community/masked-view@0.1.10
npm ERR! node_modules/@react-native-community/masked-view
npm ERR!   @react-native-community/masked-view@"0.1.10" 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.
npm ERR!


Edited question #1 :
i tried install by force but it wont work

npm install --force



npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @react-native-community/masked-view@0.1.10
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN   react@"17.0.2" from the root project
npm WARN   11 more (@react-navigation/drawer, @react-navigation/native, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.0" from @react-native-community/masked-view@0.1.10
npm WARN node_modules/@react-native-community/masked-view
npm WARN   @react-native-community/masked-view@"0.1.10" from the root project
npm WARN   1 more (@react-navigation/stack)
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN   peer react@"^16.0" from @react-native-community/masked-view@0.1.10
npm WARN   node_modules/@react-native-community/masked-view
npm WARN     @react-native-community/masked-view@"0.1.10" from the root project
npm WARN     1 more (@react-navigation/stack)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @react-navigation/stack@5.14.3
npm WARN Found: @react-navigation/native@6.0.6
npm WARN node_modules/@react-navigation/native
npm WARN   @react-navigation/native@"^6.0.6" from the root project
npm WARN   1 more (@react-navigation/drawer)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer @react-navigation/native@"^5.0.5" from @react-navigation/stack@5.1
4.3
npm WARN node_modules/@react-navigation/stack
npm WARN   @react-navigation/stack@"^5.2.9" from the root project
npm WARN
npm WARN Conflicting peer dependency: @react-navigation/native@5.9.8
npm WARN node_modules/@react-navigation/native
npm WARN   peer @react-navigation/native@"^5.0.5" from @react-navigation/stack@5
.14.3
npm WARN   node_modules/@react-navigation/stack
npm WARN     @react-navigation/stack@"^5.2.9" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-native@0.63.2
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN   react@"17.0.2" from the root project
npm WARN   11 more (@react-navigation/drawer, @react-navigation/native, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"16.13.1" from react-native@0.63.2
npm WARN node_modules/react-native
npm WARN   react-native@"https://github.com/expo/react-native/archive/sdk-42.0.0
.tar.gz" from the root project
npm WARN   12 more (@react-native-community/masked-view, ...)
npm WARN
npm WARN Conflicting peer dependency: react@16.13.1
npm WARN node_modules/react
npm WARN   peer react@"16.13.1" from react-native@0.63.2
npm WARN   node_modules/react-native
npm WARN     react-native@"https://github.com/expo/react-native/archive/sdk-42.0
.0.tar.gz" from the root project
npm WARN     12 more (@react-native-community/masked-view, ...)
npm ERR! code EBUSY
npm ERR! syscall rename


Edited Question #2

yarn install work for me to install all module but application did not give proper output , npm start work but it give me blank screen with error so may be some module not compatible with current version of react . not sure

yarn install 




yarn install v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @react-native-community/masked-view@0.1.10" has incorrect peer depen
dency "react@^16.0".
warning " > @react-navigation/stack@5.14.3" has incorrect peer dependency "@reac
t-navigation/native@^5.0.5".
warning "react-native > metro-react-native-babel-transformer@0.59.0" has unmet p
eer dependency "@babel/core@*".
warning "babel-preset-expo > @babel/plugin-proposal-decorators@7.13.5" has unmet
 peer dependency "@babel/core@^7.0.0-0".
warning "babel-preset-expo > @babel/preset-env@7.13.10" has unmet peer dependenc
y "@babel/core@^7.0.0-0".
warning "babel-preset-expo > metro-react-native-babel-preset@0.59.0" has unmet p
eer dependency "@babel/core@*".
warning "expo > babel-preset-expo > @babel/plugin-proposal-decorators > @babel/h
elper-create-class-features-plugin@7.13.11" has unmet peer dependency "@babel/co
re@^7.0.0".
warning "expo > babel-preset-expo > @babel/plugin-proposal-decorators > @babel/p
lugin-syntax-decorators@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0
".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/helper-compilatio
n-targets@7.13.10" has unmet peer dependency "@babel/core@^7.0.0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-a
sync-generator-functions@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0
".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-d
ynamic-import@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-e
xport-namespace-from@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-j
son-strings@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-l
ogical-assignment-operators@7.13.8" has unmet peer dependency "@babel/core@^7.0.
0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-n
umeric-separator@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-o
bject-rest-spread@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-o
ptional-catch-binding@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-p
rivate-methods@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-u
nicode-property-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".

warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-asy
nc-generators@7.8.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-cla
ss-properties@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-dyn
amic-import@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-exp
ort-namespace-from@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-jso
n-strings@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-log
ical-assignment-operators@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-
0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-nul
lish-coalescing-operator@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0"
.
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-num
eric-separator@7.10.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-obj
ect-rest-spread@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-opt
ional-catch-binding@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-opt
ional-chaining@7.8.3" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-syntax-top
-level-await@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
arrow-functions@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
async-to-generator@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
block-scoped-functions@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0"
.
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
block-scoping@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
classes@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
computed-properties@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
destructuring@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
dotall-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
duplicate-keys@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
exponentiation-operator@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0
".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
for-of@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
function-name@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
literals@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
member-expression-literals@7.12.13" has unmet peer dependency "@babel/core@^7.0.
0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
modules-amd@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
modules-systemjs@7.13.8" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
modules-umd@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
named-capturing-groups-regex@7.12.13" has unmet peer dependency "@babel/core@^7.
0.0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
new-target@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
object-super@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
parameters@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
property-literals@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
regenerator@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
reserved-words@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
shorthand-properties@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
spread@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
sticky-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
template-literals@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
typeof-symbol@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
unicode-escapes@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-transform-
unicode-regex@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/preset-modules@0.
1.4" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > babel-plugin-polyfill-co
rejs2@0.1.10" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > babel-plugin-polyfill-co
rejs3@0.1.7" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > @babel/preset-env > babel-plugin-polyfill-re
generator@0.1.6" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-proposal-export-default-from@7.12.13" has unmet peer dependency "@babel/core
@^7.0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-syntax-export-default-from@7.12.13" has unmet peer dependency "@babel/core@^
7.0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-syntax-flow@7.12.13" has unmet peer dependency "@babel/core@^7.0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-object-assign@7.12.13" has unmet peer dependency "@babel/core@^7.0
.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-react-display-name@7.12.13" has unmet peer dependency "@babel/core
@^7.0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-react-jsx@7.12.17" has unmet peer dependency "@babel/core@^7.0.0-0
".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-react-jsx-self@7.12.13" has unmet peer dependency "@babel/core@^7.
0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-react-jsx-source@7.12.13" has unmet peer dependency "@babel/core@^
7.0.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-runtime@7.13.10" has unmet peer dependency "@babel/core@^7.0.0-0".

warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-typescript@7.13.0" has unmet peer dependency "@babel/core@^7.0.0-0
".
warning "expo > babel-preset-expo > @babel/preset-env > @babel/plugin-proposal-u
nicode-property-regex > @babel/helper-create-regexp-features-plugin@7.12.17" has
 unmet peer dependency "@babel/core@^7.0.0".
warning "expo > babel-preset-expo > @babel/preset-env > babel-plugin-polyfill-co
rejs2 > @babel/helper-define-polyfill-provider@0.1.5" has unmet peer dependency
"@babel/core@^7.4.0-0".
warning "expo > babel-preset-expo > metro-react-native-babel-preset > @babel/plu
gin-transform-typescript > @babel/plugin-syntax-typescript@7.12.13" has unmet pe
er dependency "@babel/core@^7.0.0-0".
warning " > react-native@0.63.2" has incorrect peer dependency "react@16.13.1".
warning "react-native-reanimated > @babel/plugin-transform-object-assign@7.14.5"
 has unmet peer dependency "@babel/core@^7.0.0-0".
warning " > react-native-vector-icons@6.7.0" has unmet peer dependency "@react-n
ative-community/toolbar-android@^0.1.0-rc.1".
warning " > react-redux@7.2.2" has unmet peer dependency "redux@^2.0.0 || ^3.0.0
 || ^4.0.0-0".
[4/4] Building fresh packages...
Done in 255.28s.
jignesh

jignesh
answered Nov 30 '-1 00:00

try to force to install


npm install --force


Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

try to yarn install


yarn install  


denyy

denyy
answered Nov 30 '-1 00:00

try

npm install --legacy-peer-deps --global expo-cli


Post Answer