@clerk/clerk-expo "unable to resolve dependency tree"
juliuslissau opened this issue ยท 4 comments
Preliminary Checks
-
I have reviewed the documentation: https://clerk.com/docs
-
I have searched for existing issues: https://github.com/clerk/javascript/issues
-
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
-
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
https://github.com/juliuslissau/test-app
Publishable key
unnecessary
Description
Steps to reproduce:
- Step 1:
npx create-expo-app@latest test-app --template blank
- Step 2:
npm install @clerk/clerk-expo
Expected behavior:
@clerk/clerk-expo should install.
Actual behavior:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: test-app@1.0.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR! react@"18.2.0" from the root project
npm ERR! peer react@">=18" from @clerk/clerk-expo@1.2.6
npm ERR! node_modules/@clerk/clerk-expo
npm ERR! @clerk/clerk-expo@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.3.1" from react-dom@18.3.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@">=18" from @clerk/clerk-expo@1.2.6
npm ERR! node_modules/@clerk/clerk-expo
npm ERR! @clerk/clerk-expo@"*" from the root project
Note: It somehow works if you run npx create-expo-app@latest test-app
without --template blank
, but I don't understand why and it just installs a lot of web related packages which it seems Clerk doesn't support anyway (Currently the @clerk/expo SDK only supports mobile app output. - https://clerk.com/docs/quickstarts/expo)
Environment
System:
OS: macOS 14.3
CPU: (8) arm64 Apple M2
Memory: 99.84 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
Browsers:
Chrome: 126.0.6478.127
Safari: 17.3
npmPackages:
@babel/core: ^7.20.0 => 7.24.9
expo: ~51.0.20 => 51.0.20
expo-status-bar: ~1.12.1 => 1.12.1
react: 18.2.0 => 18.2.0
react-native: 0.74.3 => 0.74.3
Hi, thanks for the issue!
The error message is already telling you what's wrong:
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^18.3.1" from react-dom@18.3.1
npm ERR! node_modules/react-dom
npm ERR! peer react-dom@">=18" from @clerk/clerk-expo@1.2.6
Your project is missing the dependency react-dom
. It's defined as a peerDependency (read: I needs to be installed) here:
javascript/packages/expo/package.json
Line 64 in 944bb2e
Thanks for clarifying a bit more
I already tried install react-dom, just doing npm i react-dom
gives the same error.
Then running npm i react-dom@18.2.0
allows installing react-dom, but then the error with clerk persists which I didn't understand.
Now after your comment assuring it was related to react-dom, I tried npx expo install react-dom
and npx expo install @clerk/clerk-expo
which then made everything fit together. Thanks and sorry about the confusion :)
You might wanna add this to your documentation though. Seems like an good thing to have in the beginning of this article.
Glad that you got it to work ๐
Our quickstart links to https://docs.expo.dev/tutorial/create-your-first-app/ in the "Before you start" section and they have this step: https://docs.expo.dev/tutorial/create-your-first-app/#install-dependencies
I think that should cover it ๐ Support for Expo Web is also coming soon!
I resolved it by changing "react-dom": "^18.2.0" to "react-dom": "18.2.0"