在下面执行 npm install gettng 时出现 react-native 错误
In react-native error while doing npm install gettng below
今天我想安装这个lib。
但不幸的是我得到了以下错误。
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency
tree npm ERR! npm ERR! While resolving: my-app@1.0.0 npm ERR! Found:
react@17.0.1 npm ERR! node_modules/react npm ERR! react@"17.0.1"
from the root project npm ERR! npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.1" from react-native-character-input@1.0.5
npm ERR! node_modules/react-native-character-input npm ERR!
react-native-character-input@"*" 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.
我的 react-native 版本与这个库不兼容是什么意思?
你有依赖冲突(不正确且可能破坏的依赖),所以尝试运行命令--force
或 --legacy-peer-deps
。如果它没有生效,临时解决方案 正在使用 Node.js 的早期版本(降级 Node.js 版本),因为它会导致此类错误有时会发生。
尝试
npm install --legacy-peer-deps react-native-character-input --save
今天我想安装这个lib。
但不幸的是我得到了以下错误。
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: my-app@1.0.0 npm ERR! Found: react@17.0.1 npm ERR! node_modules/react npm ERR! react@"17.0.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^16.8.1" from react-native-character-input@1.0.5 npm ERR! node_modules/react-native-character-input npm ERR!
react-native-character-input@"*" 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.
我的 react-native 版本与这个库不兼容是什么意思?
你有依赖冲突(不正确且可能破坏的依赖),所以尝试运行命令--force
或 --legacy-peer-deps
。如果它没有生效,临时解决方案 正在使用 Node.js 的早期版本(降级 Node.js 版本),因为它会导致此类错误有时会发生。
尝试
npm install --legacy-peer-deps react-native-character-input --save