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

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!

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.

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

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

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

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

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

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

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

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.

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

Related

Error: ENOENT: no such file or directory, open 'fs.js

I am working in React Native using expo-cli.
All I did till now is
expo init myapp
And after adding a text to my app.js file, I tried to do
npm start
which gave me this error
Error: ENOENT: no such file or directory, open 'fs.js
I have not used anything related to fs.js and as far as I can see from the errors page, the error is in
.../node_modules/metro/src/Server.js:99:24)
And other file stack system is referring it to metro.
I am using VS code and Linux Mint for development. My expo version is: 4.3.0
The result of expo diagnostics
Expo CLI 4.3.0 environment info:
System:
OS: Linux 5.4 Linux Mint 20.1 (Ulyssa)
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 10.19.0 - /usr/bin/node
npm: 6.14.4 - /usr/bin/npm
npmPackages:
expo: ~40.0.0 => 40.0.1
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
npmGlobalPackages:
expo-cli: 4.3.0
Expo Workflow: managed
try to start as an administrator with sudo yarn start
I managed to solve it here but I'm not sure what caused this problem.
first i restarted the computer, when i did this another error similar to this one appeared
How can i make this working. I tried giving sudo permissoins
so I ran
chmod -R 0777 / tmp
But it didn't work. so I deleted the node module and ran
sudo yarn install
yarn start --reset-cache
And the problem was solved

While resolving module `react-native/Libraries/NewAppScreen`, the Haste package `react-native` was found

running expo start raises the following error:
While resolving module react-native/Libraries/NewAppScreen, the Haste package react-native was found. However the module Libraries/NewAppScreen could
not be found within the package. Indeed, none of these files exist:
* C:\...\node_modules\react-native\Libraries\NewAppScreen(.native||.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.jsx|.native.expo.jsx|.expo.jsx|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.wasm|.native.wasm|.wasm)
* C:\...\node_modules\react-native\Libraries\NewAppScreen\index(.native||.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.jsx|.native.expo.jsx|.expo.jsx|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.wasm|.native.wasm|.wasm)
Failed building JavaScript bundle.
expo-cli error
Expo CLI 3.11.1 environment info:
System:
OS: Windows 10
Binaries:
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.0 - C:\Program Files\nodejs\npm.CMD
Problem solved. I forgot to update the "sdkVersion" to "36.0.0" in app.json after I upgraded my app.
Try to install Expo CLI before run your project.
npm install -g expo-cli

Expo fails to build, Request failed with status code 400

I'm trying to build a project in expo react native project.
My expo version is 3.2.2, sdkVersion is 35.
When I ran in cmd (on Windows 10)
set EXPO_DEBUG=true
expo build:android -c
I got:
Request failed with status code 400
Error: Request failed with status code 400
at createError (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\Jonny\AppData\Roaming\npm\node_modules\expo-cli\node_modules\axios\lib\adapters\http.js:237:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I'm tried to update expo version, sdkVersion, the version in react, check for internet connection.
Expo login and logout works fine. I don't have any proxy in my network.
I don't have any clues for what search or how to fix this problem.
Seems was a error in expo-cli version 3.2.2.
The update 3.2.3 fixed for me.
I have fixed the issue by using this command
Move to your root folder then type this command in your terminal
npm install -g expo-cli
I had two versions of expo-cli installed (one via yarn global install expo-cli and one as a dev dependency in project yarn add -D expo-cli). This started working for me after I removed the global expo-cli:
yarn global remove expo-cli
and used the local version in my project instead:
yarn run expo-cli start
Run those following command, then we are good to go.
$ yarn global remove expo-cli && yarn global add expo-cli
$ rm -rf node_modules/ yarn.lock && yarn install
$ yarn run start

Cannot find module 'expo/bundleNativeModules.json'

I'm using expo to build an app. I'm new to React-Native and expo so if you could help me, I'd be really appreciated.
I get a couple of warnings that says:
Some of your project's dependencies are not compatible with currently installed expo package version
- expo-constants - expected version range: ...
- expo-permissions - expected version range: ...
- react-native-gesture-handler - expected version range: ...
Your project may not work correctly until you install the correct versions of the packages.
I was facing another error:
"TypeError: TypeError: undefined is not an object (evaluating '_styles.default.list')".
So I'm trying to install the latest version.
When I try to install expo install expo-permissions and expo install react-native-gesture-handler, I get errors.
Both errors say
Cannot find module 'expo/bundledNativeModules.json'
Require stack:
- /Users/address/src/react-native-udacicards/noop.js
I tried to remove node_modules and package-lock.json then npm install.
rollback with npm install -g expo-cli#2.4.3
I don't know if this solution will work for all the situations, but this is what fixed the issue it for me:
clean the npm cache using the following command : npm cache clean --force
re-install the dependencies : npm install
expo install
I hope it helps
1.on your package.json change expo version to
"expo": "~43.0.2", (or lower)
and your react-native-gesture-handler to
"react-native-gesture-handler": "~1.10.2",
(for expo 43.0.2)
Then, on your terminal (in your project), run
npm cache clean --force
npm install
expo doctor --fix-dependencies
I also faced this issue but Enableing USB tethering in phone, and clearing all data in expo app resolved this issue.

errors after running expo start

I have installed latest node version and expo-cli but when I run the command expo start, it gives me this error:
Starting project at C:\Users\Ogacho\Desktop\sharelocation
Expo DevTools is running at http://localhost:19002
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older.
Opening DevTools in the browser... (press shift-d to disable)
Error: React Native is not installed. Please run `npm install` in your project directory.
Couldn't start project. Please fix the errors and restart the project.
Set EXPO_DEBUG=true in your env to view the stack trace.
I have tried clearing my npm cache, deleting my node_modules folder and reinstalling...
This fixed it for me:
Run expo update 35.0.0. (Replace version with your desired version. 35.0.0 is the latest as of this post.) This updates expo, by updating app.json & package.json and installing the latest dependencies.
Referenced from:
https://docs.expo.io/versions/latest/workflow/upgrading-expo-sdk-walkthrough/
Also, check that:
your expo app is the latest version through the app/play store.
your expo cli is the latest version npm install -g expo-cli
Your project is in SDK version >= 33.0.0, but the expo package version seems to be older. If your expo-cli version is older than 2.21.2, run npm install -g expo-cli to get the latest version.
Or, you can change sdkVersion and dependencies to an older version to match the expo-cli doc.Run expo --version to get the expo-cli version. For example, if using expo-cli 2.19.5, you should
app.json, change sdkVersion to "32.0.0",
In package.json, change these dependencies:
{
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"expo": "^32.0.0",
"react": "16.5.0"
}
Delete your project’s node_modules directory and install again
Close your Expo CLI server
Run expo upgrade in your project directory (requires the latest version of expo-cli, you can update with npm i -g expo-cli).
Make sure to check the breaking changes section of this post!
Run expo start -c