【发布时间】:2021-04-06 19:01:00
【问题描述】:
我正在尝试导入 Lottie 以用于 react native 和 expo,我绝对是这方面的初学者。我安装了这个版本的 react-native:4.14.0
我不明白“解决时:undefined@undefined 是什么意思?但我想我的版本有冲突。
$ npm i --save lottie-react-native
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@16.8.3
npm ERR! node_modules/react
npm ERR! react@"16.8.3" from the root project
npm ERR! peer react@"*" from lottie-react-native@3.5.0
npm ERR! node_modules/lottie-react-native
npm ERR! lottie-react-native@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.9.0" from react-native@0.61.5
npm ERR! node_modules/react-native
npm ERR! react-native@"^0.61.4" from the root project
npm ERR! peer react-native@">=0.46" from lottie-react-native@3.5.0
npm ERR! node_modules/lottie-react-native
npm ERR! lottie-react-native@"*" 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\carol\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\carol\AppData\Local\npm-cache\_logs\2021-04-06T18_50_38_327Z-debug.log
//DEPENDENCIES from package.json:
"dependencies": {
"@react-native-community/cli-hermes": "^4.13.0",
"@react-native-community/cli-server-api": "^5.0.1-alpha.2",
"anser": "^2.0.1",
"braces": "^3.0.2",
"error-stack-parser": "^2.0.6",
"expo": "^40.0.1",
"expo-sensors": "^9.2.0",
"mem": "^8.1.0",
"minimist": "^1.2.5",
"node-stream-zip": "^1.13.3",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "^0.64.0",
"react-native-google-fonts": "^0.0.0",
"react-native-web": "^0.15.5",
"styled-components": "^5.2.3",
"use-subscription": "^1.5.1"
}
【问题讨论】:
标签: react-native expo lottie