I am trying to install new component using npm. But it gives error

Viewed 7097

I was trying to add $ npm install react-native-touchable-bounce --save but it was giving an error the same as the following. then I deleted all node_modules still getting this error. npm install gives the following error.

PS I:\Code\singal res\code\singalRes> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined      
npm ERR! Found: react-native-svg@12.1.0
npm ERR! node_modules/react-native-svg
npm ERR!   react-native-svg@"^12.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-svg@"^9.13.6" from @ui-kitten/components@5.0.0
npm ERR! node_modules/@ui-kitten/components
npm ERR!   @ui-kitten/components@"^5.0.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.
npm ERR!
npm ERR! See C:\Users\softb\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\softb\AppData\Local\npm-cache\_logs\2021-02-14T03_13_39_660Z-debug.log
3 Answers

for me adding the --force flag fixed the issue

npm i --force

maybe it's because of the lib version mismatch, you can delete the package-lock.json and node_modules, then try npm install again.

If you are getting this type of error then just go to package.json and delete react-native-svg@"^12.1.0" from the root project(yours may be different).

then just run npm-install or you better be using yarn instead of npm. yarn just works.

problem solved!

Related