Reputation: 23
I have tried it with yarn and npm both , But expo-cli just couldn't get installed, There is an error to enabled wsl. I just don't know why it is necessary and what it is. Why it just can't run solely on windows ?
npm install expo-cli --global
Tried to install the expo-cli by npm , But it is showing some multiple errors. I have posted all my cmd results below so i can get to know that what was the actual problem here.
npm WARN deprecated [email protected]: This version has been deprecated in
accordance with the hapi support policy (hapi.im/support). Please
upgrade to the latest version to get the best features, bug fixes, and
security patches. If you are unable to upgrade at this time, paid
support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in
accordance with the hapi support policy (hapi.im/support). Please
upgrade to the latest version to get the best features, bug fixes, and
security patches. If you are unable to upgrade at this time, paid
support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in
accordance with the hapi support policy (hapi.im/support). Please upgrade
to the latest version to get the best features, bug fixes, and security
patches. If you are unable to upgrade at this time, paid support is
available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This module has moved and is now available
at @hapi/hoek. Please update your dependencies as this version is no
longer maintained an may contain bugs and security issues.
> @expo/[email protected] preinstall
C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\@expo\traveling-fastlane-linux
> node platform.js
Does not seem like WSL enabled on this machine. Download a Linux distro
from the Windows Store, run it at least onceand then make sure to run in
an admin powershell:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-
Subsystem-Linux
C:\Users\HP\AppData\Roaming\npm\expo ->
C:\Users\HP\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
C:\Users\HP\AppData\Roaming\npm\expo-cli ->
C:\Users\HP\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
> [email protected] install C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\iltorb
> node ./scripts/install.js || node-gyp rebuild
info looking for cached prebuild @ C:\Users\HP\AppData\Roaming\npm-
cache\_prebuilds\c677a8-iltorb-v2.4.3-node-v64-win32-x64.tar.gz
info found cached prebuild
info unpacking @ C:\Users\HP\AppData\Roaming\npm-cache\_prebuilds\c677a8-
iltorb-v2.4.3-node-v64-win32-x64.tar.gz
info unpack resolved to C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\iltorb\build\bindings\iltorb.node
info unpack required C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\iltorb\build\bindings\iltorb.node successfully
info install Successfully installed iltorb binary!
> [email protected] install C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) ||
(node-gyp rebuild && node install/dll-copy)
info sharp Using cached C:\Users\HP\AppData\Roaming\npm-
cache\_libvips\libvips-8.7.4-win32-x64.tar.gz
ERR! sharp Please delete C:\Users\HP\AppData\Roaming\npm-
cache\_libvips\libvips-8.7.4-win32-x64.tar.gz as it is not a valid tarball
ERR! sharp zlib: unexpected end of file
info sharp Attempting to build from source via node-gyp but this may fail
due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for
required dependencies
C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed:
C:\Users\HP\AppData\Local\Programs\Python\Python37-32\python.EXE -c import
sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-
gyp.js" "rebuild"
gyp ERR! cwd C:\Users\HP\AppData\Roaming\npm\node_modules\expo-
cli\node_modules\sharp
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Upvotes: 2
Views: 983
Reputation: 1005
Open C:\Users{Username}\AppData\Roaming\npm
Delete these files: 'expo.ps1' and 'expo-cli.ps1'
Run:
npm i -g expo-cli
Upvotes: 1
Reputation: 109
sudo npm install expo-cli --global
If you are using mac or ubuntu add sudo before it. It will work.
Upvotes: 1