"npm exited with non zero code: 190" when trying to upgrade expo from 37 to 44

I am trying to upgrade the expo SDK from 37 to 45, when I run the “expo upgrade” it tries to install but ends up returning this error message:

":heavy_check_mark: You are currently using SDK 37.0.0. Would you like to update to the latest version, 45.0.0? … yes

:heavy_multiplication_x: Failed to install expo package with error: npm exited with non-zero code: 190 npm exited with non-zero code: 190 Error: npm exited with non-zero code: 190 at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13) at Object.onceWrapper (node:events:642:26) at ChildProcess.emit (node:events:527:28) at maybeClose (node:internal/child_process:1092:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302: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)"

my package.json says “cli”: “^1.0.1”, “eas”: “^0.1.0”, “eas-cli”: “^0.22.0”, “expo”: “^45.0.0”, “expo-ads-admob”: “^8.1.0”, “expo-asset”: “~8.1.5”, “expo-cli”: “^4.7.3”, “expo-font”: “~8.1.0”,"

I was not able to find any helpful info yet. Please help to upgrade successfully!

Best, Evan

my package.json says “cli”: “^1.0.1”, “eas”: “^0.1.0”, “eas-cli”: “^0.22.0”, “expo”: “^45.0.0”, “expo-ads-admob”: “^8.1.0”, “expo-asset”: “~8.1.5”, “expo-cli”: “^4.7.3”, “expo-font”: “~8.1.0”,"

you shouldn’t have eas-cli and expo-cli in your package json, it should be installed globally in your system

eas package have nothing to do with expo or eas build service, so I recommend to remove it unless you are using it for sth and you know what it does

If the above does not help try running it with env EXPO_DEBUG=1
What happens if you just change expo package to ^45.0.0 and run npm install?

Hi @evanr1234

In addition to what wkozyra said, it’s normally safer to upgrade one step at a time. So:

expo upgrade 38

then read the release notes for SDK 38 and make any necessary changes mentioned there.

Then:

expo upgrade 39

etc.

I have also occasionally found it necessary to remove my lock file (package-lock.json or yarn.lock) and node_modules and re-install the dependencies before an upgrade would work smoothly.

Hi Guys,

So I removed the eas-cli and the expo-cli from expo, and then tried to upgrade incrementally to expo 38. It first said error code 1, and now it is back to: “Failed to install expo package with error: npm exited with non-zero code: 190”.

When I try to build it to the app store with the “eas build:configure”, it give the errors in the attached screen shot. After reading that I started to try to install fastlane in the command prompt and doing “fastlane init” in the project directory, and it said there is no IOS app in the directory. I honestly am not very familiar with these systems if you can’t tell.

Best Regards,
Evan

Please run npx expo-env-info and paste the output here?

Also, please post the complete list of dependencies and devDependencies from package.json

expo doctor in logs for your last build is reporting bunch of incompatible dependencies, fix those first by running expo doctor --fix-dependencies

1 Like

Hi Guys,

So I ran the doctor --fix command, tried to build it again with “eas build:configure”, and it still has the same fastlane errors. I tried to run “fastlane init” and it says “It looks like there is no iOS project in the current directory, though we did find one in a sub-directory”

I also ran the npx info command, see screen shots for output.

Thank you!

As I said previously :slight_smile:

Please paste this as text. Not a screenshot.

here is package.json!

{
  "name": "my-new-project",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/samples": "2.1.1",
    "@react-native-community/async-storage": "^1.12.1",
    "@react-native-community/masked-view": "0.1.6",
    "@react-navigation/bottom-tabs": "^5.5.2",
    "cli": "^1.0.1",
    "eas": "^0.1.0",
    "expo": "^38.0.0",
    "expo-ads-admob": "^8.1.0",
    "expo-asset": "~8.1.5",
    "expo-font": "~8.1.0",
    "fastlane": "^0.1.0",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "^0.61.4",
    "react-native-elements": "^2.0.2",
    "react-native-gesture-handler": "~1.6.0",
    "react-native-modal-overlay": "^1.3.1",
    "react-native-reanimated": "~1.7.0",
    "react-native-render-html": "^4.2.0",
    "react-native-responsive-screen": "^1.4.1",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "~2.2.0",
    "react-native-simple-radio-button": "^2.7.4",
    "react-native-viewport-units": "^0.0.5",
    "react-native-webview": "8.1.1",
    "react-navigation": "^4.3.9",
    "react-navigation-stack": "^2.7.0",
    "react-navigation-tabs": "^2.8.13",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "babel-preset-expo": "^8.1.0",
    "jest-expo": "^31.0.0"
  }
}

Thanks

Are you referencing @expo/samples in your code? If so, how? I see that version 2.1.1 is not the latest version, but off hand I don’t know what problems that might cause and whether upgrading will help with your current problems.

cli is for node scripts for running at the command line. It makes no sense to have it as a dependency in a mobile app.

As @wkozyra mentioned, eas has nothing to do with Expo’s “EAS”. Based on the description here I would guess it has something to do with web development, but it was last published 5 years ago and the homepage no longer exists. I am pretty sure you should not have this installed.

I’m not sure what this fastlane package is. I can’t install it. I’m pretty sure it has nothing to do with this and anyway you should not have it as a dependency.

I suppose these are still on version 16.9.x because you were upgrading from SDK 37. If you create a new SDK 38 app (expo init sdk38_app -t blank@sdk-38) you’ll see these have a version range of "~16.11.0".

This should be:

    "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.3.tar.gz",

The default devDependencies for a new SDK 38 app are as follows:

  "devDependencies": {
    "@babel/core": "^7.8.6",
    "babel-preset-expo": "~8.1.0"
  },

After running expo upgrade 38 on the new SDK 38 app I get this:

  "devDependencies": {
    "@babel/core": "^7.8.6",
    "babel-preset-expo": "^8.2.3"
  },

so you may want to add @babel/core to your devDependencies and upgrade babel-preset-expo to "^8.2.3".

I did not remove the EAS because this iOS app does pull data from an existing web app and I wasn’t sure if it would be needed for this.

I searched the code for the text “@expo/samples” and did not find anything except in the package-lock.json and package.json, Should I delete this from the package.json?

  • for expo upgrade 38, terminal says npm exited to non-zero code: 1 (this is after making most of the changes requested to the package.json file)

  • when I run "


    npm install --save react@latest" I get output saying it found another version of react

When I try to build with the requested changes on the package.json (I am building using command “eas build:configure”, it says:

“Running “npm install” in the root dir of your repository

2

[stderr]

npm WARN old lockfile

3

[stderr]

npm WARN old lockfile The package-lock.json file was created with an old version of npm,

4

[stderr]

npm WARN old lockfile so supplemental metadata must be fetched from the registry.

5

[stderr]

npm WARN old lockfile

6

[stderr]

npm WARN old lockfile This is a one-time fix-up, please be patient…

7

[stderr]

npm WARN old lockfile

8

[stderr]

npm

9

[stderr]

ERR! code ERESOLVE

10

[stderr]

npm ERR!

11

[stderr]

ERESOLVE unable to resolve dependency tree

12

[stderr]

npm ERR!

13

[stderr]

npm ERR! While resolving: my-new-project@undefined

14

[stderr]

npm ERR! Found: react@16.9.0

15

[stderr]

npm ERR! node_modules/react

16

[stderr]

npm ERR! react@“~16.9.0” from the root project

17

[stderr]

npm ERR! peer react@“^16.0” from @react-native-community/masked-view@0.1.6

18

[stderr]

npm ERR!

19

[stderr]

node_modules/@react-native-community/masked-view

20

[stderr]

npm ERR! @react-native-community/masked-view@“0.1.6” from the root project

21

[stderr]

npm ERR!

22

[stderr]

npm ERR! Could not resolve dependency:

23

[stderr]

npm ERR! peer react@“16.11.0” from react-native@0.62.2

24

[stderr]

npm ERR! node_modules/react-native

25

[stderr]

npm ERR! react-native@“https://github.com/expo/react-native/archive/sdk-38.0.3.tar.gz” from the root project

26

[stderr]

npm ERR! peer react-native@“>=0.57” from @react-native-community/masked-view@0.1.6

27

[stderr]

npm ERR! node_modules/@react-native-community/masked-view

28

[stderr]

npm ERR! @react-native-community/masked-view@“0.1.6” from the root project

29

[stderr]

npm ERR!

30

[stderr]

npm ERR! Fix the upstream dependency conflict, or retry

31

[stderr]

npm ERR! this command with --force, or --legacy-peer-deps

32

[stderr]

npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

33

[stderr]

npm ERR!

34

[stderr]

npm ERR! See /Users/expo/.npm/eresolve-report.txt for a full report.

35

[stderr]

36

[stderr]

npm ERR! A complete log of this run can be found in:

37

[stderr]

npm ERR! /Users/expo/.npm/_logs/2022-06-24T00_36_09_670Z-debug.log

38

npm exited with non-zero code: 1”

And attempting at building again without some the changes, gave a similar rejection as before with

:x: error: Value for SWIFT_VERSION cannot be empty. (in target ‘SelfCareAZ’ from project ‘SelfCareAZ’)

108

:x: error: Value for SWIFT_VERSION cannot be empty. (in target ‘SelfCareAZ’ from project ‘SelfCareAZ’)

I did a command to upgrade the lock-file and it still was not working.

Also, I installed fast lane and tried to run it because the expo rejections on the website/build page said to run fast lane.

Do you offer telephone support?

Thank you,

Evan

Also, Is there a easy development environment I can download to view and test the app other than x code? X code cannot open this for some reason. Thank you.

Hi

Please remove the eas dependency. I am sure you do not need it. You can always add it back later if I am wrong.

Which changes did you make/not make?

Don’t do that. Each Expo SDK has a specific version of react, react-dom, react-native, react-native-web and some other packages that it is compatible with. You can’t generally just upgrade to the latest version. (If you have a bare workflow app then you may be able to, but then you’re not using something that’s been verified to work.) expo upgrade, expo install ..., expo doctor --fix-dependencies should use the correct versions of these packages.

EAS Build only works with Expo SDK versions 41 and up. You will first need to sort out the dependency issues and after that upgrade to a more recent version of the Expo SDK before you can use EAS Build.

Just running “npm install” should fix the lock file as long as the dependencies can actually be installed.

You don’t need fastlane for a managed app.

I am just an Expo user. I don’t work for them.

If you have a paid plan you could try: Contact Us — Expo
Otherwise you could also try Discord: https://chat.expo.dev/
There are also consultants who might be able to help: Consultants — Expo

This is a manged app, so it does not include the native iOS code (or Android code). So the Xcode and Android Studio projects do not exist. Perhaps have a look through the guides and the tutorial, but unfortunately because your app is on quite an old version of the Expo SDK you will not be able to open it in Expo Go.

I suggest you try the following:

  • Remove package-json.lock
  • Remove node_modules
  • Replace your dependencies/devDependencies in package.json with the following:
  "dependencies": {
    "@react-native-community/async-storage": "~1.11.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/bottom-tabs": "^5.5.2",
    "expo": "~38.0.8",
    "expo-ads-admob": "~8.2.1",
    "expo-asset": "~8.1.7",
    "expo-font": "~8.2.1",
    "react": "16.11.0",
    "react-dom": "16.11.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.3.tar.gz",
    "react-native-elements": "^2.0.2",
    "react-native-gesture-handler": "~1.6.0",
    "react-native-modal-overlay": "^1.3.1",
    "react-native-reanimated": "~1.9.0",
    "react-native-render-html": "^4.2.0",
    "react-native-responsive-screen": "^1.4.1",
    "react-native-safe-area-context": "~3.0.7",
    "react-native-safe-area-view": "^1.1.1",
    "react-native-screens": "~2.9.0",
    "react-native-simple-radio-button": "^2.7.4",
    "react-native-viewport-units": "^0.0.5",
    "react-native-webview": "9.4.0",
    "react-navigation": "^4.3.9",
    "react-navigation-stack": "^2.7.0",
    "react-navigation-tabs": "^2.8.13",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.6",
    "babel-preset-expo": "^8.2.3",
    "jest-expo": "^38.0.0"
  },
  • Run npm install

If that fails, paste the error here.

If npm install completes successfully, commit the changes and run expo upgrade 39.

Let us know how it goes.

upon making the requested changes and running npm install, I got the following errors:

In addition to previous message, this is my current package.json:

{
  "name": "my-new-project",
  "main": "node_modules/expo/AppEntry.js",
  "private": true,
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "eject": "expo eject",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@react-native-community/async-storage": "~1.11.0",
 "@react-native-community/masked-view": "0.1.10",
 "@react-navigation/bottom-tabs": "^5.5.2",
 "expo": "~38.0.8",
 "expo-ads-admob": "~8.2.1",
 "expo-asset": "~8.1.7",
 "expo-font": "~8.2.1",
 "react": "16.11.0",
 "react-dom": "16.11.0",
 "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.3.tar.gz",
 "react-native-elements": "^2.0.2",
 "react-native-gesture-handler": "~1.6.0",
 "react-native-modal-overlay": "^1.3.1",
 "react-native-reanimated": "~1.9.0",
 "react-native-render-html": "^4.2.0",
 "react-native-responsive-screen": "^1.4.1",
 "react-native-safe-area-context": "~3.0.7",
 "react-native-safe-area-view": "^1.1.1",
 "react-native-screens": "~2.9.0",
 "react-native-simple-radio-button": "^2.7.4",
 "react-native-viewport-units": "^0.0.5",
 "react-native-webview": "9.4.0",
 "react-navigation": "^4.3.9",
 "react-navigation-stack": "^2.7.0",
 "react-navigation-tabs": "^2.8.13",
 "react-redux": "^7.2.0",
 "redux": "^4.0.5",
 "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.6",
     "babel-preset-expo": "^8.2.3",
     "jest-expo": "^38.0.0"
  }
}

Please run npm install --legacy-peer-deps

sorry for the late response, I have been working night shifts. I ran the command and got:


" evanredmond@Evans-MacBook-Pro Self_Care_AZ191 % npm install --legacy-peer-deps

npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated

npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'

npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0

npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added

npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'

npm WARN deprecated @unimodules/core@5.3.0: replaced by the 'expo' package, learn more: https://blog.expo.dev/whats-new-in-expo-modules-infrastructure-7a7cdda81ebc

npm WARN deprecated @unimodules/react-native-adapter@5.4.0: replaced by the 'expo' package, learn more: https://blog.expo.dev/whats-new-in-expo-modules-infrastructure-7a7cdda81ebc

npm WARN deprecated deep-assign@3.0.0: Check out `lodash.merge` or `merge-options` instead.

npm WARN deprecated @react-native-community/masked-view@0.1.10: Repository was moved to @react-native-masked-view/masked-view

npm WARN deprecated @react-native-community/async-storage@1.11.0: Async Storage has moved to new organization: https://github.com/react-native-async-storage/async-storage

npm WARN deprecated core-js@1.2.7: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

added 1601 packages, and audited 1602 packages in 58s

88 packages are looking for funding

run `npm fund` for details

**42** vulnerabilities (18 **moderate**, 12 **high**, 12 **critical**)

To address issues that do not require attention, run:

npm audit fix

To address all issues possible (including breaking changes), run:

npm audit fix --force

Some issues need review, and may require choosing

a different dependency.

Run `npm audit` for details."

Believe it or not that actually looks good :sweat_smile:

I suggest you commit the changes (I expect only package.json and package-lock.json) before proceeding.

Run expo doctor to make sure Expo is happy. Then check the SDK 38 release blog post to see if there are any breaking changes that affect you. If so, make the necessary changes and commit them.

Then try expo upgrade 39

EDIT: About all those warnings: npm audit is problematic

I did not see any breaking changes that seemed relevant. I ran the doctor and the expo upgrade command and am still getting a similar results: