expo / expo-cli

Tools for creating, running, and deploying universal Expo and React Native apps
https://docs.expo.io/workflow/expo-cli/
2.61k stars 477 forks source link

Installation failing for 3.8.0+ #1284

Closed mdwoodruff2 closed 4 years ago

mdwoodruff2 commented 4 years ago

Description

Install seems to fail after some recent updates. All versions up to 3.7.1 seem to install correctly.

Expected Behavior

I would expect the install to be successful.

Observed Behavior

npm install --global expo-cli@3.7.1 (Success) npm install --global expo-cli@3.8.0 (Fails) npm install --global expo-cli (Fails)

> test -d .git && cp gitHookPrePush.sh .git/hooks/pre-push || true

'test' is not recognized as an internal or external command,
operable program or batch file.
'true' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-darwin-ia32@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-darwin-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-darwin-ia32@2.2.8: wanted {"os":"darwin","arch":"ia32"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-freebsd-ia32@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-freebsd-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-freebsd-ia32@2.2.8: wanted {"os":"freebsd","arch":"ia32"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-darwin-x64@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-darwin-x64@2.2.8: wanted {"os":"darwin","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-freebsd-x64@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-freebsd-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-freebsd-x64@2.2.8: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/traveling-fastlane-darwin@1.10.0 (node_modules\expo-cli\node_modules\@expo\traveling-fastlane-darwin):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/traveling-fastlane-darwin@1.10.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\expo-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-win32-ia32@2.2.8-beta.1 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-win32-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-win32-ia32@2.2.8-beta.1: wanted {"os":"win32","arch":"ia32"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-sunos-x64@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-sunos-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-sunos-x64@2.2.8: wanted {"os":"sunos","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-x64@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-x64@2.2.8: wanted {"os":"linux","arch":"x64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-ia32@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-linux-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-ia32@2.2.8: wanted {"os":"linux","arch":"ia32"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-arm64@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-arm64@2.2.8: wanted {"os":"linux","arch":"arm64"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-linux-arm@2.2.8 (node_modules\expo-cli\node_modules\@expo\ngrok-bin-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-linux-arm@2.2.8: wanted {"os":"linux","arch":"arm"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! envsub@3.1.0 postinstall: `test -d .git && cp gitHookPrePush.sh .git/hooks/pre-push || true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the envsub@3.1.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Environment

Expo CLI 3.7.1 environment info: System: OS: Windows 10 Binaries: Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.13.1 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312

Reproducible Demo

npm install --global expo-cli

mpcen commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get past it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

bandcult commented 4 years ago

Confirmed that the same issue happens for me when running npm install -g expo-cli. Looks like an issue with envsub: the postinstall hook script contains && which can be only used in Linux shell.

hodgef commented 4 years ago

Indeed, expo-cli 3.9.1 won't install on Windows.

image

Hopefully CI testing can be expanded, as the builds are only tested on Ubuntu at the moment: https://circleci.com/gh/expo/expo-cli/tree/master

Edit: Seems to have been proposed by @brentvatne in https://github.com/expo/expo-cli/issues/1260

davidroyo commented 4 years ago

This issue is real, tomorrow i got an interview using react native (expo) and can't install it. I'm fucked, hope anyone can fix this pls

davidroyo commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get passed it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

Thx bro, you saved my interview, worked for me

arsath-thariq commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get passed it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

not working installation having issue again

arsath-thariq commented 4 years ago

i am install node js latest version and iam trying to install react Native but its not working kindly help me to solve the issue

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! envsub@3.1.0 postinstall: test -d .git && cp gitHookPrePush.sh .git/ho ks/pre-push || true npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the envsub@3.1.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional log ing output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\thariq\AppData\Roaming\npm-cache_logs\2019-12-03T05_38_23 984Z-debug.log

jass1121 commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get passed it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

Thanx Brother Its Working you Saved my Life

ghost commented 4 years ago

Thanks soooooo much. Its now working.

akewlguy4eva commented 4 years ago

Thanks Also , Thought I was screwed unless I bought a linux machine. :)

vitorbertolucci commented 4 years ago

Thank you, I was having the same issue but was able to install using git bash

ciruz commented 4 years ago

thank you @mpcen

cgrcnr commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get past it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

worked for me thx. with running C:\Program Files\Git\git-bash.exe

kasraouiii commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get past it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

the install work , but in cmd the command expo doesn't known

rusty-jnr commented 4 years ago

Was having this same issue when using Windows Powershell or CMD.exe. Was able to get past it by using Git Bash. Try running npm install -g expo-cli from a MINGW64 terminal (ex: Git Bash)

Thanks a lot it installed successfully

brentvatne commented 4 years ago

this should be resolved on 3.10.2. the issue was that @expo/build-tools was installing a library called envsub that would fail on windows 10 in powershell/cmd.exe, so we switched that to an optional dependency - you will still see that envsub failed to install but the installation of expo-cli should succeed. we're going to consider breaking @expo/build-tools and similar functionality into a separate cli tool to avoid issues like this in the future.

gauravsahu8691 commented 3 years ago

Indeed, expo-cli 3.9.1 won't install on Windows.

image

Hopefully CI testing can be expanded, as the builds are only tested on Ubuntu at the moment: https://circleci.com/gh/expo/expo-cli/tree/master

Edit: Seems to have been proposed by @brentvatne in #1260

https://github.com/facebook/react-native/issues/26575#issuecomment-589450778 resolved the problem

NithyashreeChandrasekar commented 2 years ago

cp -R node_modules_patches/ node_modules/ 'cp' is not recognized as an internal or external command, operable program or batch file.