31

Im currently trying to update my Expo SDK from 36.0.0 to atleast 37.0.0 with the command expo update however im getting the error:

  × Failed to install expo package with error: yarnpkg exited with non-zero code: 1
yarnpkg exited with non-zero code: 1
Error: yarnpkg exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:65:13)
    at Object.onceWrapper (events.js:422:26)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.cp.emit (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at Object.spawnAsync [as default] (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\spawn-async\src\spawnAsync.ts:26:19)
    at YarnPackageManager._runAsync (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\package-manager\src\NodePackageManagers.ts:288:31)
    at YarnPackageManager.addAsync (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\package-manager\src\NodePackageManagers.ts:241:16)
    at upgradeAsync (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\src\commands\upgrade.ts:465:5)
    at C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\src\commands\upgrade.ts:701:7
    at Command.<anonymous> (C:\Users\Philipp\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:302:7)

npm version : 6.14.8 yarn version : 2.2.2 i also tried it with a lower version 1.x.x expo diagnostics :

 Expo CLI 3.27.4 environment info:
    System:
      OS: Windows 10 10.0.19041
    Binaries:
      Node: 12.18.3 - C:\Program Files\nodejs\node.EXE
      Yarn: 2.2.2 - C:\Users\Philipp\AppData\Roaming\npm\yarn.CMD
      npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      expo: ^36.0.0 => 36.0.2
      react: 16.9.0 => 16.9.0
      react-dom: 16.9.0 => 16.9.0
      react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
      react-native-web: ^0.11.7 => 0.11.7
      react-navigation: 3.11.1 => 3.11.1
    Expo Workflow: managed

Hopefully someone can help me, any help is appreciated. Thank you very much!

Rajendran Nadar
  • 4,962
  • 3
  • 30
  • 51
HCx3
  • 413
  • 1
  • 4
  • 5

13 Answers13

48

This is one way how I solved this issue.

I deleted the yarn.lock file & .expo folder and tried running expo upgrade and it worked.

I was upgrading from SDK 44 to SDK 45.

Rajendran Nadar
  • 4,962
  • 3
  • 30
  • 51
41

remove this line from package.json

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

now remove node_modules

now:

yarn install

now add that line back in package.json

again

yarn install

now if it succeeds, do a

expo upgrade

I solved after 2 days

Faisal Shahzad
  • 694
  • 9
  • 13
7

I ran yarn install (npm install should do the same thing.) in my project folder first. Then expo upgrade command worked.

Goodmedalist
  • 357
  • 4
  • 8
4

By any chance is this a monorepo? I ran into this error because I accidentally upgrade expo in the root folder

Lalaland
  • 118
  • 7
1

This is one way how I solved this issue.

I deleted the yarn.lock file & .expo folder and tried running expo upgrade and it worked.

I was upgrading from SDK 44 to SDK 45.

Ahmad Tech
  • 21
  • 1
  • 1
1

I deleted the yarn.lock file and tried running expo upgrade and it worked.

0

I ran yarn install (npm install should do the same thing.) in my project folder first. Then expo upgrade command worked.

Test
  • 1
  • 1
0

just install expo-notifications using normal package installation as below instead of expo install expo-notifications use

npm i expo-notifications

ndotie
  • 1,830
  • 17
  • 18
0

I was running expo upgrade from root directory of my app and experienced the same error I changed to the directory of my mobile app and it ran successfully without any errors

SQ59
  • 1
  • 1
0

Only thing I did is to delete the yarn.lock then run the upgrade command, the non-zero error goes away

Joe Lu
  • 2,240
  • 1
  • 15
  • 18
0

It looks like you’re using an old version of npm. Try upgrading. Also make sure you’re using a recent even-numbered version of node (e.g. version 16 or 18)

If that doesn’t fix it, you can try running the following:

npm config set legacy-peer-deps true

You can set it back to the default false again afterwards.

Mr. H0341
  • 1
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 29 '23 at 17:32
0

I had the same issue when trying to run :

npx create-expo-app AwesomeProject

The cause of the problem: dependency issue between the packages coming from react-native package , so if u try to remove react-native from package.json then -> npm install no errors will appear.

The solution:

  • Go to package.json
  • Change the react-native version // mine was 17.1 I changed it to 17.0
  • Remove node modules
  • Run : npm install --legacy-peer-deps

And now it should be solved ! CHEERS !

Rawand Deheliah
  • 1,220
  • 10
  • 11
0

I'm working on expo react native, the latest version.

This worked for me:

  • Deleting .expo
  • Deleting node_modules
  • npm install
  • expo upgrade
Mostafa
  • 815
  • 1
  • 13
  • 23