How to upgrade project expo version

Please provide the following:

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): ios
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Replace this section with as much relevant information as possible and any relevant code along with your question.

I updated the expo 42 version.
However, package.json file is version 40 for the project that was created prior to the update .
How can I get it up to version 42?

What should I do if there is an npm error after the update?

1 Like

Hi @chosan

What did you do so far to upgrade?

Your app.json should no longer have the line mentioning the SDK version, and you should upgrade by using the expo upgrade command.

You might want to first run expo upgrade 41.0.0 and make sure everything works there before upgrading to SDK 42. Also make sure you read the SDK 41 and 42 announcements on and take care of and breaking changes mentioned there.

HI! @wodin
I do “expo upgrade 42.0.0”
And as a result, I got three errors.
fail to upgrade javascript dependencies [library],
running npm install failed ,
failed to clear packager cache with error: package.json.

I still looking for a way

@choseonghyun have you ever tried using “npm start --reset-cache” or, if you are using expo-cli “expo r -c”?
try clearing the cache with the code above and then try using “expo update 42.0.0”

Please post your app.json, package.json and the error messages you are getting?

I do “expo upgrade 42.0.0”
√ Would you like to proceed? … yes

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

√ Would you like to upgrade the Expo app in the Android emulator? … no
√ Installed expo@^42.0.0
√ Validated configuration.
√ No additional changes necessary to app.json config.
× Failed to upgrade JavaScript dependencies: react-native-svg@12.1.1 @react-native-community/netinfo@6.0.0 expo-notifications@~0.12.3 react-native-safe-area-context@3.2.0 @react-native-community/masked-view@0.1.10 expo-local-authentication@~11.1.1 react-native-reanimated@~2.2.0 react-native-webview@11.6.2 expo-secure-store@~10.2.0 expo-status-bar@~1.0.4 @react-native-async-storage/async-storage@~1.15.0 @react-native-picker/picker@1.16.1 expo-application@~3.2.0 expo-screen-orientation@~3.2.1 react-native-screens@~3.4.0 expo-constants@~11.0.1 react-native-gesture-handler@~1.10.2 sentry-expo@^4.0.0 @react-native-community/slider@3.0.3 jest-expo@^42.0.0 react-native@ react@16.13.1 react-dom@16.13.1 react-native-web@~0.13.12
√ 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: Can’t read JSON file: C:[file path]node_modules\expo\package.json
├─ File: C:[file path]node_modules\expo\package.json
└─ Cause: Error: ENOENT: no such file or directory, open
‘C:[file path]\package.json’
√ Cleared packager cache.

:clap: Automated upgrade steps complete.
…but this doesn’t mean everything is done yet!

:white_check_mark: The following packages were updated:
[updated package name]

:rotating_light: The following packages were not updated. You should check the READMEs for those repositories to determine what version is compatible with your new set of packages:
@fortawesome/fontawesome-svg-core, @fortawesome/free-regular-svg-icons, @fortawesome/free-solid-svg-icons, @fortawesome/react-native-fontawesome, @ptomasroos/react-native-multi-slider, @react-navigation/bottom-tabs, @react-navigation/material-bottom-tabs, @react-navigation/material-top-tabs, @react-navigation/native, @react-navigation/stack, @sentry/react-native, axios, moment, native-base, query-string, radio-buttons-react-native, react-native-calendars, react-native-chart-kit, react-native-datepicker, react-native-device-info, react-native-dropdown-picker, react-native-easy-grid, react-native-elements, react-native-exception-handler, react-native-fetch-blob, react-native-flexi-radio-button, react-native-image-base64, react-native-keyboard-aware-scroll-view, react-native-linear-gradient, react-native-machine-info, react-native-orientation, react-native-paper, react-native-picker-select, react-native-responsive-fontsize, react-native-snap-carousel, react-native-svg-uri, react-native-switches, react-native-tab-view, react-native-testing-library, react-native-touch-id, react-native-vector-icons, react-test-renderer, babel-jest, enzyme, enzyme-adapter-react-16, jest, jest-environment-enzyme, jest-enzyme, regenerator-runtime

and node_modules files is don’t exist.
How can I reinstall the node_modules file.

You might try deleting the whole node_modules directory and npm-error.log and then re-running npm install.
If this fails, post the contents of npm-error.log

1 Like

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