我正在尝试使用 npm 安装新组件。但它给出了错误

san*_*eni 11 reactjs react-native npm-install

我试图添加,$ npm install react-native-touchable-bounce --save但它给出了与以下相同的错误。然后我删除了所有node_modules仍然出现此错误。 npm install给出以下错误。

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
Run Code Online (Sandbox Code Playgroud)

kat*_*nas 11

对我来说添加--force标志解决了这个问题

npm i --force


vuo*_*gvu 5

可能是lib版本不匹配的原因,你可以删除 和package-lock.jsonnode_modules然后npm install重试。