【问题标题】:Error when i run this comand in react native project: expo install react-native-maps当我在反应本机项目中运行此命令时出错:expo install react-native-maps
【发布时间】:2021-07-29 22:08:08
【问题描述】:

我正在尝试在 react native 项目中运行此命令: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>

【问题讨论】:

    标签: react-native google-maps npm expo react-native-maps


    【解决方案1】:

    这是由于 npm v7. 使用下面安装 react-native-maps,它应该可以工作。

    npm install react-native-maps --legacy-peer-deps
    

    【讨论】:

      【解决方案2】:

      我遇到了同样的错误,运行 --legacy-peer-deps 解决了这个问题。

      【讨论】:

        【解决方案3】:

        我遇到了同样的问题,使用--legacy-peer-deps 标志安装解决了它。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2020-01-23
          • 2020-11-18
          • 1970-01-01
          • 2022-08-19
          • 2021-12-11
          • 1970-01-01
          • 2020-04-30
          相关资源
          最近更新 更多