我正在尝试在react原生项目中运行这个命令:expo install react-native-maps。但是,它总是返回此错误。我尝试删除node_modules并重新安装它们,但错误仍然存在。请帮帮我,提前谢谢!
C:\Users\ASUS TUFF\Documents\Study\maps-react-native\react-native-maps>expo install react-native-maps
Installing 1 SDK 42.0.0 compatible native module using npm.
> 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-web@0.13.18
npm ERR! node_modules/react-native-web
npm ERR! react-native-web@"~0.13.12" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-web@"^0.11" from react-native-maps@0.28.0
npm ERR! node_modules/react-native-maps
npm ERR! react-native-maps@"0.28.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\ASUS TUFF\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\ASUS TUFF\AppData\Local\npm-cache\_logs\2021-07-29T20_29_51_765Z-debug.log
npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\ASUS TUFF\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.cp.emit (C:\Users\ASUS TUFF\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
...
at Object.spawnAsync [as default] (C:\Users\ASUS TUFF\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:26:19)
at NpmPackageManager._runAsync (C:\Users\ASUS TUFF\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\package-manager\src\NodePackageManagers.ts:166:31)
at NpmPackageManager.addAsync (C:\Users\ASUS TUFF\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\package-manager\src\NodePackageManagers.ts:105:18)
at actionAsync (C:\Users\ASUS TUFF\AppData\Roaming\npm\node_modules\expo-cli\src\commands\installAsync.ts:122:3)
C:\Users\ASUS TUFF\Documents\Study\maps-react-native\react-native-maps>发布于 2021-08-07 04:34:29
这要归功于npm v7。使用下面的命令来安装react-native-map,它应该可以工作。
npm install react-native-maps --legacy-peer-deps发布于 2021-08-26 19:18:25
我也遇到了同样的错误,运行--legacy-peer-deps解决了这个问题。
发布于 2021-09-21 01:31:17
我遇到了同样的问题,使用--legacy-peer-deps标志安装解决了这个问题。
https://stackoverflow.com/questions/68583312
复制相似问题