Reactnative:安装expo-cli时出现代码ELIFECYCLE错误 [英] Reactnative: code ELIFECYCLE error When installing expo-cli

查看:14
本文介绍了Reactnative:安装expo-cli时出现代码ELIFECYCLE错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据 官方网站在 windows 10 上安装 expo-cli一个>:

I am trying to install expo-cli on windows 10, according it's official site:

>npm install expo-cli --global

我收到以下错误:

C:UsersTazika.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:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modules@expo	raveling-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:UsersTazika.SAFARAYANEHAppDataRoaming
pmexpo-cli -> C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cliinexpo.js
C:UsersTazika.SAFARAYANEHAppDataRoaming
pmexpo -> C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cliinexpo.js

> dtrace-provider@0.8.8 install C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesdtrace-provider
> node-gyp rebuild || node suppress-error.js


C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesdtrace-provider>if not defined npm_config_node_gyp (node "C:Program Files
odejs
ode_modules
pm
ode_modules
pm-lifecycle
ode-gyp-bin\....
ode_modules
ode-gypin
ode-gyp.js" rebuild )  else (node "C:Program Files
odejs
ode_modules
pm
ode_modules
ode-gypin
ode-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:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesiltorb
> node ./scripts/install.js || node-gyp rebuild

info looking for cached prebuild @ C:UsersTazika.SAFARAYANEHAppDataRoaming
pm-cache\_prebuilds95b49f-iltorb-v2.4.4-node-v72-win32-x64.tar.gz
info found cached prebuild
info unpacking @ C:UsersTazika.SAFARAYANEHAppDataRoaming
pm-cache\_prebuilds95b49f-iltorb-v2.4.4-node-v72-win32-x64.tar.gz
info unpack resolved to C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesiltorbuildindingsiltorb.node
info unpack required C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesiltorbuildindingsiltorb.node successfully
info install Successfully installed iltorb binary!

> sharp@0.22.1 install C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulessharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:UsersTazika.SAFARAYANEHAppDataRoaming
pm-cache\_libvipslibvips-8.7.4-win32-x64.tar.gz
info sharp Creating C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulessharpuildRelease
info sharp Copying DLLs from C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulessharpvendorlib to C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulessharpuildRelease

> core-js@2.6.10 postinstall C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulescore-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:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesejs
> node ./postinstall.js

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


> envsub@3.1.0 postinstall C:UsersTazika.SAFARAYANEHAppDataRoaming
pm
ode_modulesexpo-cli
ode_modulesenvsub
> 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_modulesexpo-cli
ode_modules@expo	raveling-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_modulesexpo-cli
ode_modulesfsevents):
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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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_modulesexpo-cli
ode_modules@expo
grok-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:UsersTazika.SAFARAYANEHAppDataRoaming
pm-cache\_logs2019-12-01T14_19_42_669Z-debug.log

我使用的是python版本:

I am using python version:

>python --version
Python 3.8.0

以及节点和 npm 版本:

and node and npm versions:

>node --version
v12.13.1

>npm --version
6.12.1

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

I installed visual studio 2015, i think is good to know that. What is your suggestion?

这是完全错误

推荐答案

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

Finally i fixed my problem after a day trying:

根据这篇文章

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

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

After these installations i think this part is important:

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

postinstall script of envsub depends on built-in unix shell commands. So any shell compatible with unix shell should works, like Git BASH

这篇关于Reactnative:安装expo-cli时出现代码ELIFECYCLE错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆