Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Expo CLI cant be installed in Linux #591

Closed
edoantonioco opened this issue May 8, 2019 · 31 comments
Closed

Expo CLI cant be installed in Linux #591

edoantonioco opened this issue May 8, 2019 · 31 comments
Labels
Installation The issue pertains to installing expo-cli OS: Linux The issue is occurring on Linux (or a variant of)

Comments

@edoantonioco
Copy link

edoantonioco commented May 8, 2019

Description

In linux to install expo cli you use "sudo npm install -g expo-cli" (sudo is a requirement sadly)

I try to install expo cli, and installation fails

Also to note I reinstalled Linux Manjaro to see if the error got fixed (it doesnt)

Also, this only happens since latest expo cli, previously it worked fine.

Expected Behavior

I expected to install expo cli

Observed Behavior

]$ sudo npm install -g expo-cli  
npm WARN deprecated joi@14.0.4: 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 joi@11.4.0: 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 topo@2.0.2: 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 hoek@4.2.1: 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 hoek@6.1.3: 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.
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

> @expo/traveling-fastlane-linux@1.9.3 preinstall /usr/lib/node_modules/expo-cli/node_modules/@expo/traveling-fastlane-linux
> node platform.js

/usr/bin/expo -> /usr/lib/node_modules/expo-cli/bin/expo.js
/usr/bin/expo-cli -> /usr/lib/node_modules/expo-cli/bin/expo.js

> iltorb@2.4.3 install /usr/lib/node_modules/expo-cli/node_modules/iltorb
> node ./scripts/install.js || node-gyp rebuild

WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/11.14.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/expo-cli/node_modules/iltorb/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/expo-cli/node_modules/iltorb/.node-gyp'
gyp ERR! System Linux 4.19.36-1-MANJARO
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/expo-cli/node_modules/iltorb
gyp ERR! node -v v11.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

> sharp@0.22.1 install /usr/lib/node_modules/expo-cli/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

ERR! sharp EACCES: permission denied, mkdir '/root/.npm'
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
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/11.14.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/expo-cli/node_modules/sharp/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/expo-cli/node_modules/sharp/.node-gyp'
gyp ERR! System Linux 4.19.36-1-MANJARO
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/expo-cli/node_modules/sharp
gyp ERR! node -v v11.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/traveling-fastlane-darwin@1.9.3 (node_modules/expo-cli/node_modules/@expo/traveling-fastlane-darwin):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/traveling-fastlane-darwin@1.9.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","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":"linux","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":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @expo/ngrok-bin-win32-x64@2.2.8-beta.1 (node_modules/expo-cli/node_modules/@expo/ngrok-bin-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @expo/ngrok-bin-win32-x64@2.2.8-beta.1: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","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":"linux","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":"linux","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":"linux","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":"linux","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":"linux","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":"linux","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":"linux","arch":"x64"})
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":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@2.4.3 (node_modules/expo-cli/node_modules/iltorb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@2.4.3 install: `node ./scripts/install.js || node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.22.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-08T15_11_03_835Z-debug.log

@AdamJNavarro AdamJNavarro added Installation The issue pertains to installing expo-cli OS: Linux The issue is occurring on Linux (or a variant of) labels May 8, 2019
@thinkbruno
Copy link

thinkbruno commented May 8, 2019

I'm using Ubuntu 18.04.2 LTS and I have the same errors!

@edoantonioco
Copy link
Author

edoantonioco commented May 8, 2019

I solved this by installing it with yarn
yarn global add expo-cli

So npm + expo is broken somehow

@thinkbruno
Copy link

I had not yarn, but in my first attempt the terminal returns:

Command 'yarn' not found, but can be installed with:

apt install cmdtest

I made it, but after this install, the error appears:

00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'global'

@sakharovsergey
Copy link

Try to run without sudo
set chown -R $(whoami) $(npm config get prefix)/*
set chown -R $(whoami) ~/.npm/

@thinkbruno
Copy link

I made it too, but doesn't works too :(

@byCedric
Copy link
Member

byCedric commented May 8, 2019

Having the same issues when trying to build the base image for Expo GitHub Action.

byCedric added a commit to expo/expo-github-action that referenced this issue May 8, 2019
This is related to NPM failing for both iltorb and sharp dependencies. Let's work around this by using Yarn for now.

expo/expo-cli#591
byCedric added a commit to expo/expo-github-action that referenced this issue May 8, 2019
This is related to NPM failing for both iltorb and sharp dependencies. Let's work around this by using Yarn for now.

expo/expo-cli#591
@mertcelenk
Copy link

mertcelenk commented May 9, 2019

Hello,

I used npm, logs are below.
yarn worked, thanks.

logs for npm
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.22.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mert_celenk/.npm/_logs/2019-05-09T07_06_24_111Z-debug.log

@thinkbruno
Copy link

yarn worked form me too, thanks for the support :)

@naomiHauret
Copy link

yarn didn't work for me and I can't rollback to the previous expo-cli version that worked before... installing it on windows (with yarn or npm) doesn't work either.

@brunogirin
Copy link

I have the same issue in CI using the node:8 or node:12 images. Installing via yarn rather than npm fixes the problem. Here is the relevant part of my Gitlab CI script to reproduce:

image: node:12

before_script:
  # Build dependencies
  - npm install -g yarn expo-cli

@lovell
Copy link

lovell commented May 10, 2019

For those using npm, the need to install globally can be avoided by using its npx command:

npx expo-cli ...

If there's no alternative and you absolutely have to install a package with native dependencies globally as root via sudo then use the unsafe-perm flag to grant root access to those packages:

sudo npm install -g --unsafe-perm expo-cli

@thinkbruno
Copy link

sudo npm install --unsafe-perm expo-cli
It works for me! Thanks!

@papismurf
Copy link

sudo npm install -g --unsafe-perm expo-cli
Worked for me too! (Ubuntu 18.04 LTS)
Thanks!

@donghoon-song
Copy link

sudo npm install -g --unsafe-perm explo-cli
also worked for me
Thank you so much!
(Ubuntu 18.04.2 LTS)

@dreyser
Copy link

dreyser commented May 20, 2019

Yarn alternative solved if for me as well, (mac os).. it broke down after an upgrade

@ArtemBosenko
Copy link

I solved this by installing it with yarn
yarn global add expo-cli

So npm + expo is broken somehow

Worked after:
sudo yarn global add expo-cli

@imrizwan
Copy link

imrizwan commented May 22, 2019

After spending almost 1 day, i resolved this issue, this error is due to sharp

If you are having issues during installation consider removing the directory C:\Users[user]\AppData\Roaming\npm-cache_libvips.

npm install -g sharp (The installation require python 2.7 on windows and path env configuration)

npm install -g expo-cli

@zopagaduanjr
Copy link

zopagaduanjr commented May 24, 2019

Ubuntu 18.04 user here.
Sharp seems to be the error, then i tried using npm install -g sharp .
After that, i got the error Error: EACCES: permission denied, access '/usr/local/lib/node_modules' .
I then resorted into using sudo chmod 777 /usr/local/lib/node_modules .
Installing sharp again, it went through and installed successfully.
Lastly, running npm install -g expo-cli would be successful.
I also did the chmod 777 trick in macOS and it also went successful. The only thing to do in mac is too restart it after.

@vahidalvandi
Copy link

Try running npm install expo-cli --global instead, you need the dashes to signify it’s a flag

@Daniel-Griffiths
Copy link

Same issue here,

Running yarn global add expo-cli installed expo, but I had to chmod my .expo folder in the project directory before the expo command would work properly.

@sirmong
Copy link

sirmong commented Jun 19, 2019

sudo npm install -g --unsafe-perm expo-cli
it works!

@therobwatson
Copy link

To resolve permissions issues, I followed instructions to re-install npm via Node Version Manager. I didn't have to uninstall npm before re-installing it.

I followed instructions here (https://github.com/nvm-sh/nvm), which means I just ran the following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
(The above command downloads the installation script, runs it, and then updates bash)

Once the nvm installation was complete, I closed my terminal and re-opened it (to apply bash updates), and then I installed the latest stable version of npm using the "node" keyword:
nvm install node

And, there you go, Bob's father's your father's father (Bob's your uncle).

Now you can retry the npm installation and it should work. For me, I was hitting permissions errors while trying to install expo-cli via npm. When I re-ran that command after installing npm via nvm, the command worked fine.

@CovertCode
Copy link

I tried all the above methods and none of them worked for me.
Also complied latest nodejs from the source still can't install expo-cli.
But I can easily install other global modules only one I can't install is expo-cli.
Seems like the problem was not with my build. It's an issue with expo

@vahidalvandi
Copy link

I tried all the above methods and none of them worked for me.
Also complied latest nodejs from the source still can't install expo-cli.
But I can easily install other global modules only one I can't install is expo-cli.
Seems like the problem was not with my build. It's an issue with expo

yes it have issue in install expo

@GPrince00
Copy link

sudo npm install -g --unsafe-perm expo-cli
Worked for me too! (Ubuntu 18.04.3 LTS)
Thanks!

@ImAshokDev
Copy link

sudo npm install -g --unsafe-perm expo-cli
same issue in it

@khanirrfan
Copy link

@edoantonioco just do npm intall -g expo-cli
worked for me for same configurations

@charlie39
Copy link

i am getting errors with both npm and yarn.
;)

@hariniabi
Copy link

I am also getting same error... is it something to do windows? I am running in windows 7... :( it was working fine few days back
my vs code version is 1.41.1

@brentvatne
Copy link
Member

sorry what is the error that you are seeing? you could not possibly be seeing the same error as the original post because expo-cli does not include sharp anymore. the other warnings are unavoidable and the result of optionalDependencies in npm which are included specifically to support multiple platforms :)

@brentvatne
Copy link
Member

i'm closing this because the original topic of this issue was installation issues due to sharp, which no longer is included in expo-cli. if you are having problems installing expo-cli please create a new issue and include information specific to what is going wrong in your situation. thanks!

@expo expo locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Installation The issue pertains to installing expo-cli OS: Linux The issue is occurring on Linux (or a variant of)
Projects
None yet
Development

No branches or pull requests