'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!



Solution 1:[1]

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

Solution 2:[2]

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

Solution 3:[3]

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.

Solution 4:[4]

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

Solution 5:[5]

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

npm i expo-notifications

Solution 6:[6]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lalaland
Solution 2 Goodmedalist
Solution 3 Rajendran Nadar
Solution 4
Solution 5 ndotie
Solution 6