expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

Cannot install expo-cli global (windows 10)

Open AHAMES opened this issue 7 years ago • 37 comments

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.

AHAMES avatar May 25 '19 11:05 AHAMES

#607

Wellers0n avatar May 25 '19 14:05 Wellers0n

perhaps may help you

Wellers0n avatar May 25 '19 14:05 Wellers0n

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 👍

cruzach avatar May 28 '19 21:05 cruzach

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

liudonghua123 avatar Sep 28 '19 14:09 liudonghua123

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

unrealmaow avatar Sep 29 '19 11:09 unrealmaow

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

fatihyildizhan avatar Dec 04 '19 19:12 fatihyildizhan

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.

sherifkhattab13 avatar Jan 10 '20 22:01 sherifkhattab13

Follow the steps

  • First, run npm cache verify.
  • Open Windows PowerShell as administrator and run npm install expo-cli --global --no-optional command.

utsav284 avatar Feb 11 '20 07:02 utsav284

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

ElyesChine avatar Mar 06 '20 22:03 ElyesChine

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).

mhpm avatar Mar 10 '20 19:03 mhpm

please help!

mhpm avatar Mar 10 '20 19:03 mhpm

nothing of above worked for me =(

mhpm avatar Mar 10 '20 22:03 mhpm

@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

fatihyildizhan avatar Mar 10 '20 23:03 fatihyildizhan

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? image

mhpm avatar Mar 11 '20 01:03 mhpm

solved finallly doing this: npm i [email protected] --global thanks @fatihyildizhan for the time.

mhpm avatar Mar 11 '20 09:03 mhpm

npm cache clean --force then sudo npm install --unsafe-perm -g expo-cli

moelzanaty3 avatar Mar 21 '20 21:03 moelzanaty3

not worked for me

image

npm cache clean --force then sudo npm install --unsafe-perm -g expo-cli

kgbuddhima avatar Mar 22 '20 04:03 kgbuddhima

@kgbuddhima try this command npm i [email protected] --global

if this does not work then follow these steps: https://gist.github.com/fatihyildizhan/98e89603272bce512cd7308dc2b5c461

fatihyildizhan avatar Mar 22 '20 05:03 fatihyildizhan

Follow the steps

  • First, run npm cache verify.
  • Open Windows PowerShell as administrator and run npm install expo-cli --global --no-optional command.

Thanks

NguyenHa1980 avatar Mar 25 '20 04:03 NguyenHa1980

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

wellingtonmacena avatar Mar 29 '20 20:03 wellingtonmacena