errors trying to upgrade to SDK 41: unable to find the expo-asset package

Please run expo diagnostics and paste the log that’s printed out along with your question or issue!

PS path> expo upgrade
We couldn't find a git repository in your project directory.
It's recommended to back up your project before proceeding.

√ Would you like to proceed? ... yes

√ You are currently using SDK 40.0.0. Would you like to update to the latest version, 41.0.0? ... yes

√ Would you like to upgrade the Expo app in the Android emulator? ... no

√ Installed expo@^41.0.0
‼ Please manually delete the sdkVersion field in your project app config file. It is now automatically determined based on the expo package version in your package.json.
√ No additional changes necessary to app config.
√ Updated known packages to compatible versions.
√ Removed package-lock.json and deleted node_modules.
× Running npm install failed. Please check npm-error.log for more information.
× Failed to clear packager cache with error: Unable to find the expo-asset package in the current project. Install it and try again.
√ Cleared packager cache.

I then reverted, ran expo install expo-asset. Tried again, same result.

Couldn’t find that npm-error.log

hi there. i don’t quite understand the problem. expo-asset is a dependency of the expo package: expo/package.json at f2c4d7a7bce7063dbbf12e7b4c604c907306472e · expo/expo · GitHub - you’re likely just seeing that error because npm install failed, so nothing is actually installed in your project.

can you run this command again then go to the project directory and run npm install to see what the full error is?

thanks for looking into this. i was also confused. when i revert, delete node_modules and run npm install, it installs without errors (no expo-asset entry in package.json).

i’ll try again…

in the meantime, the diagnostics:

  Expo CLI 4.4.2 environment info:
    System:
      OS: Windows 10 10.0.19041
    Binaries:
      Node: 14.16.1 - C:\Program Files\nodejs\node.EXE
      npm: 7.10.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  4.1.0.0 AI-201.8743.12.41.7042882
    npmPackages:
      expo: ~40.0.0 => 40.0.1
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
      react-native-web: ~0.13.12 => 0.13.18
    Expo Workflow: managed

this is the error that happens during expo upgarde:

103 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\rho\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
104 verbose node v14.16.1
105 verbose npm  v7.10.0
106 error code ERESOLVE
107 error ERESOLVE unable to resolve dependency tree
108 error
109 error While resolving: undefined@undefined
109 error Found: react@16.13.1
109 error node_modules/react
109 error   react@"16.13.1" from the root project
109 error
109 error Could not resolve dependency:
109 error peer react@"17.0.2" from react-test-renderer@17.0.2
109 error node_modules/react-test-renderer
109 error   react-test-renderer@"^17.0.1" from the root project
109 error
109 error Fix the upstream dependency conflict, or retry
109 error this command with --force, or --legacy-peer-deps
109 error to accept an incorrect (and potentially broken) dependency resolution.
109 error
109 error See C:\Users\rho\AppData\Local\npm-cache\eresolve-report.txt for a full report.

looks like a npm 7 issue with your dependencies. run npm install --legacy-peer-deps in the project directory or use npm 6 instead. it seems you have a version of react-test-renderer that requires react 17, so you can move that to react-test-render@16 also

hm, i don’t even know why i have react-test-renderer as a dependency. dont’ remember actively installing it. i’ll try to delete it.

I removed the react-test-renderer dependency. Now the upgrade ran without errors, and npm install also worked.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.