【问题标题】:Reactnative: code ELIFECYCLE error When installing expo-cliReact Native:安装expo-cli时出现代码ELIFECYCLE错误
【发布时间】:2019-12-01 22:38:54
【问题描述】:

我正在尝试在 windows 10 上安装 expo-cli, 根据它的 official site:

>npm install expo-cli --global

我收到以下错误:

C:\Users\Tazika.SAFARAYANEH>npm install expo-cli --global
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 fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm WARN deprecated core-js@2.6.10: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
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 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 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@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.11.0 preinstall C:\Users\Tazika.SAFARAYANEH\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\Tazika.SAFARAYANEH\AppData\Roaming\npm\expo-cli -> C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js
C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\expo -> C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js

> dtrace-provider@0.8.8 install C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\dtrace-provider
> node-gyp rebuild || node suppress-error.js


C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\dtrace-provider>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 )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.

> iltorb@2.4.4 install C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\iltorb
> node ./scripts/install.js || node-gyp rebuild

info looking for cached prebuild @ C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm-cache\_prebuilds\95b49f-iltorb-v2.4.4-node-v72-win32-x64.tar.gz
info found cached prebuild
info unpacking @ C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm-cache\_prebuilds\95b49f-iltorb-v2.4.4-node-v72-win32-x64.tar.gz
info unpack resolved to C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\iltorb\build\bindings\iltorb.node
info unpack required C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\iltorb\build\bindings\iltorb.node successfully
info install Successfully installed iltorb binary!

> sharp@0.22.1 install C:\Users\Tazika.SAFARAYANEH\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\Tazika.SAFARAYANEH\AppData\Roaming\npm-cache\_libvips\libvips-8.7.4-win32-x64.tar.gz
info sharp Creating C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\sharp\vendor\lib to C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\sharp\build\Release

> core-js@2.6.10 postinstall C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\core-js
> node postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> ejs@2.7.4 postinstall C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> envsub@3.1.0 postinstall C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm\node_modules\expo-cli\node_modules\envsub
> 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/traveling-fastlane-darwin@1.11.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.11.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 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/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-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 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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Tazika.SAFARAYANEH\AppData\Roaming\npm-cache\_logs\2019-12-01T14_19_42_669Z-debug.log

我使用的是python版本:

>python --version
Python 3.8.0

以及节点和 npm 版本:

>node --version
v12.13.1

>npm --version
6.12.1

我安装了 visual studio 2015,我觉得很高兴知道这一点。 你有什么建议?

这是complete error

【问题讨论】:

    标签: react-native expo


    【解决方案1】:

    经过一天的尝试,我终于解决了我的问题:

    According this post

    1- Download and install Git SCM
    2- Download Visual Studio Community HERE and install a Custom Installation, selecting ONLY the following packages: VISUAL C++, PYTHON TOOLS FOR VISUAL STUDIO and MICROSOFT WEB DEVELOPER TOOLS
    3- Download and install Python 2.7.x
    4- Register a Environment Variable with name: GYP_MSVS_VERSION with this value: 2015
    

    在这些安装之后,我认为这部分很重要:

    envsub

    postinstall 脚本依赖于内置的 unix shell 命令。所以任何与 unix shell 兼容的 shell 都应该可以工作,比如 Git BASH

    【讨论】:

      猜你喜欢
      • 2020-03-26
      • 2021-09-12
      • 1970-01-01
      • 2019-05-29
      • 2021-02-26
      • 1970-01-01
      • 2020-05-28
      • 2020-05-27
      • 2020-07-23
      相关资源
      最近更新 更多