Upgrading from SDK46 to SDK 47 with expo-cli upgrade fails

Please provide the following:

  1. SDK Version: from 46 to 47
  2. Platforms(Android/iOS/web/all): Android/iOS

I’m trying to upgrade a SDK 46 project to SDK 47. After making a expo-cli upgrade (expo-cli version i 6.0.8). When trying to install expo package 47 it fail with this error:

 ✖ Failed to install expo package with error: npm exited with non-zero code: 1
 npm exited with non-zero code: 1
 Error: npm exited with non-zero code: 1
     at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
     at Object.onceWrapper (events.js:520:26)
     at ChildProcess.emit (events.js:400:28)
     at maybeClose (internal/child_process.js:1088:16)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
     ...
     at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
     at NpmPackageManager._runAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:166:31)
     at NpmPackageManager.installAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:82:16)
     at NpmPackageManager.addWithParametersAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:96:18)
     at NpmPackageManager.addAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/package-manager/src/NodePackageManagers.ts:109:5)
     at upgradeAsync (/usr/local/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:496:7)
     at actionAsync (/usr/local/lib/node_modules/expo-cli/src/commands/info/upgradeAsync.ts:42:3)

The SDK 46 project dependecies were installed with command npm install --legacy-peer-deps i dont know if this is related with the error obtained with the upgrade command. Some information:

npm: 8.19.2
node: 14.21.1
expo-cli: 6.0.8

this the package.json of SDK46 Project:

{
  "name": "it.sportcountryclubarezzo",
  "version": "21.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.2.0",
    "@react-native-picker/picker": "2.4.2",
    "@react-navigation/drawer": "^6.4.1",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "expo": "^46.0.0",
    "expo-constants": "~13.2.4",
    "expo-font": "~10.2.0",
    "expo-linking": "~3.2.2",
    "expo-notifications": "~0.16.1",
    "expo-splash-screen": "~0.16.2",
    "expo-web-browser": "~11.0.0",
    "moment": "^2.20.1",
    "native-base": "^3.4.6",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.69.5",
    "react-native-autocomplete-input": "^5.1.1",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-masked-text": "^1.6.5",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-svg": "12.3.0",
    "react-native-webview": "11.23.0",
    "react-redux": "^7.2.5",
    "redux": "^4.1.1",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "babel-eslint": "^8.2.1",
    "eslint": "^4.15.0",
    "eslint-plugin-flowtype": "^2.41.0",
    "eslint-plugin-import": "^2.8.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-prettier": "^2.4.0",
    "eslint-plugin-react": "^7.5.1",
    "prettier-eslint": "^8.7.4"
  },
  "private": true
}

Hi @ingegnosi

What version of npm are you using? (npm --version)
I see you have updated your post with the version info.

You could try setting legacy-peer-deps to true in your npm config:

npm config set legacy-peer-deps=true

and you can set it back to false after the upgrade.

2 Likes

Thank you @wodin for your support. Making a npm config set legacy-peer-deps=true and then a expo-cli upgrade it worked: the upgrade process completed successfully.

2 Likes