Cannot install expo-cli global (windows 10)
Description
I can't install expo-cli npm 6.9.0, node v12.3.1 (also tried stable 10.15.3 got same result)
Expected Behavior
npm install expo-cli --global
then I tried yarn global add expo-cli, it remained in the state described bellow
Observed Behavior
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 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.
npm WARN deprecated [email protected]: 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.
npm WARN @expo/[email protected] requires a peer of @expo/xdl@^53.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm ERR! path C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Ahmed\\AppData\\Roaming\\npm\\node_modules\\.staging\\lodash-74eaa97c'
npm ERR! },
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink ' +
npm ERR! "'C:\\Users\\Ahmed\\AppData\\Roaming\\npm\\node_modules\\.staging\\lodash-74eaa97c'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Ahmed\\AppData\\Roaming\\npm\\node_modules\\.staging\\lodash-74eaa97c',
npm ERR! parent: '@babel/core'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ahmed\AppData\Roaming\npm-cache\_logs\2019-05-25T10_31_54_660Z-debug.log
yarn
yarn global v1.16.0
[1/4] Resolving packages...
warning expo-cli > @expo/xdl > [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).
info There appears to be trouble with your network connection. Retrying...
warning expo-cli > @expo/xdl > joi > [email protected]: 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.
warning expo-cli > @expo/xdl > joi > [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.
warning expo-cli > @expo/xdl > joi > topo > [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.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
warning expo-cli > @expo/xdl > @expo/webpack-config > workbox-webpack-plugin > workbox-build > [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).
warning expo-cli > @expo/xdl > @expo/webpack-config > workbox-webpack-plugin > workbox-build > joi > [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).
warning expo-cli > @expo/xdl > @expo/webpack-config > workbox-webpack-plugin > workbox-build > joi > [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).
warning expo-cli > @expo/xdl > @expo/webpack-config > workbox-webpack-plugin > workbox-build > joi > topo > [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).
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
[2/4] Fetching packages...
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The CPU architecture "x64" is incompatible with this module.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The CPU architecture "x64" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The platform "win32" is incompatible with this module.
info "@expo/[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info @expo/[email protected]: The CPU architecture "x64" is incompatible with this module.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo-cli > @expo/[email protected]" has incorrect peer dependency "@expo/xdl@^53.8.0".
[4/4] Building fresh packages...
[-/5] ⠁ waiting...
[-/5] ⠁ waiting...
[-/5] ⠁ waiting...
[4/5] ⠁ sharp
[-/5] ⠂ waiting...Terminate batch job (Y/N)? y
Environment
Please run expo diagnostics in the project folder and copy the output here:
C:\Users\Ahmed>expo diagnostics 'expo' is not recognized as an internal or external command, operable program or batch file.
#607
perhaps may help you
Hey @AHAMES,
Take a look at this issue for a possible solution. Let me know if that helps!
Side note- Always worth it to google the issues you're having before posting 👍
I have the same issue, I use yarn global add expo-cli.
The installation process was stucked in the
[4/4] Building fresh packages...
[-/5] ⠁ waiting...
[-/5] ⠁ waiting...
[-/5] ⠁ waiting...
[4/5] ⠁ sharp
[-/5] ⠂ waiting...
It seems have some issue with sharp, see https://github.com/lovell/sharp/issues/1882
I also have some issue in installing or upgrading expo. please check the generated log below.. i am attaching the log file. please check and give me solution. log file.txt
I upgraded node version to 12 then used git bash. This scenario worked for me.
I used the standard command: npm install expo-cli --global
In my case, i deleted two files then everything worked. the 2 files are in this path: C:\Users{Username}\AppData\Roaming\npm under the names 'expo.ps1' and 'expo-cli.ps1' then run:
npm i -g [email protected]
Hope that helps.
Follow the steps
- First, run
npm cache verify. - Open Windows PowerShell as administrator and run
npm install expo-cli --global --no-optionalcommand.
I deleted the file causing the problem (' C:\Users\Ahmed\AppData\Roaming\npm\node_modules.staging\lodash-74eaa97c' in your case) When re-running the command , it works smoothly
i have the same issue here, i can't solve it.
npm ERR! path C:\Users\Ahmed\AppData\Roaming\npm\node_modules.staging\lodash-74eaa97c npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall unlink npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules.staging\lodash-74eaa97c' npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules.staging\lodash-74eaa97c'] { npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules.staging\lodash-74eaa97c'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c' npm ERR! }, npm ERR! stack: 'Error: EPERM: operation not permitted, unlink ' + npm ERR! "'C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c'", npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'unlink', npm ERR! path: 'C:\Users\Ahmed\AppData\Roaming\npm\node_modules\.staging\lodash-74eaa97c', npm ERR! parent: '@babel/core' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator (though this is not recommended).
please help!
nothing of above worked for me =(
@mhpm
I used these to install it:
bash you need to change the default terminal as bash first.
-> https://conemu.github.io/
maybe the new windows terminal does support bash too
-> https://github.com/microsoft/terminal/releases
Nodejs: I don't need a higher version and it can give errors.
-> v12.9.0
then run I ran this command on conEmu
-> npm install expo-cli --global
Voilà!
I hope this works for you too.
Plus, if you need to upgrade your older expo project to a newer version then you may check these steps too.
-> https://gist.github.com/fatihyildizhan/3e4e038422e7522211409a93e3302ee1
Hello @fatihyildizhan Thanks for take the time for answer me, i did all you tell my but i have the same error =(, the only different thing is my node version 12.16.1, should i uninstall it and install a lower version?

solved finallly doing this: npm i [email protected] --global thanks @fatihyildizhan for the time.
npm cache clean --force then sudo npm install --unsafe-perm -g expo-cli
not worked for me

npm cache clean --forcethensudo npm install --unsafe-perm -g expo-cli
@kgbuddhima try this command npm i [email protected] --global
if this does not work then follow these steps: https://gist.github.com/fatihyildizhan/98e89603272bce512cd7308dc2b5c461
Follow the steps
- First, run
npm cache verify.- Open Windows PowerShell as administrator and run
npm install expo-cli --global --no-optionalcommand.
Thanks
Npm install -g expo-cli I runned the command and it showed the message
npm WARN deprecated [email protected]: request has been deprecated
i thought that the file was corrupt, but wasn't. it spent 15 minutes to install in my pc