Getting this error whine trying to install expo-camera
Installing 1 SDK 40.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! Found: @unimodules/core@6.0.0
npm ERR! node_modules/@unimodules/core
npm ERR! @unimodules/core@"~6.0.0" from expo@40.0.0
npm ERR! node_modules/expo
npm ERR! expo@"~40.0.0" from the root project
npm ERR! peer @unimodules/core@"*" from expo-application@2.4.1
npm ERR! node_modules/expo-application
npm ERR! expo-application@"~2.4.1" from expo@40.0.0
npm ERR! node_modules/expo
npm ERR! expo@"~40.0.0" from the root project
npm ERR! 1 more (expo-location)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @unimodules/core@"~5.1.2" from expo-camera@9.1.0
npm ERR! node_modules/expo-camera
npm ERR! expo-camera@"~9.1.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 /home/muaz/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/muaz/.npm/_logs/2020-12-12T16_45_39_635Z-debug.log
npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1
at ChildProcess.completionListener (/usr/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (node:events:483:26)
at ChildProcess.emit (node:events:376:20)
at maybeClose (node:internal/child_process:1055:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
...
at Object.spawnAsync [as default] (/usr/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at NpmPackageManager._runAsync (/usr/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:157:31)
at NpmPackageManager.addAsync (/usr/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:100:18)
at installAsync (/usr/lib/node_modules/expo-cli/src/commands/install.ts:129:3)
at Command.<anonymous> (/usr/lib/node_modules/expo-cli/src/exp.ts:346:7)
Hey @mmuaz, I just created a new bare project and installed expo-camera without issue. I would recommend deleting your node_modules, clearing your caches and then trying to install it again.
I normally use yarn, but tried it with npm now, since that’s what you’re using:
$ expo init test --npm
✔ Choose a template: › blank a minimal app as clean as an empty canvas
✔ Downloaded and extracted project files.
📦 Using npm to install packages.
✔ Installed JavaScript dependencies.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd test
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
$ cd test
$ expo install expo-camera
Installing 1 SDK 40.0.0 compatible native module using npm.
> npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 3 packages from 3 contributors and audited 912 packages in 10.234s
21 packages are looking for funding
run `npm fund` for details
found 9 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
╭────────────────────────────────────────────────────────────────╮
│ │
│ New patch version of npm available! 6.14.8 → 6.14.9 │
│ Changelog: https://github.com/npm/cli/releases/tag/v6.14.9 │
│ Run npm install -g npm to update! │
│ │
╰────────────────────────────────────────────────────────────────╯
$
so you definitely should not be getting a warning about @unimodules/core@5.1.2 anymore, and the expo-camera version that is getting installed should be 9.1.1
I’m using npm 7.0.14. It suddenly started working. I don’t know what is the reason. It works sometime but most of the time i’m getting the error i posted earlier.
Complain on the forums again. Or on the GitHub issue tracker if you can give all the details about the circumstances like OS, version of nodejs, version of npm, version of expo-cli, etc.