Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to install expo package with error: yarnpkg exited with non-zero code: 1 yarnpkg exited with non-zero code: 1

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!

like image 478
HCx3 Avatar asked Sep 10 '20 11:09

HCx3


4 Answers

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

like image 81
Faisal Shahzad Avatar answered Oct 18 '22 18:10

Faisal Shahzad


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.

like image 24
Rajendran Nadar Avatar answered Oct 18 '22 17:10

Rajendran Nadar


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

like image 5
Goodmedalist Avatar answered Oct 18 '22 18:10

Goodmedalist


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

like image 4
Lalaland Avatar answered Oct 18 '22 17:10

Lalaland