安装expo-cli时出现代码ELIFECYCLE错误

时间:2019-12-01 13:18:48

标签: node.js npm

array(1) {
  ["errors"]=>
  array(1) {
    [0]=>
    array(2) {
      ["code"]=>
      int(215)
      ["message"]=>
      string(24) "Bad Authentication data."
    }
  }
}

我遇到以下错误:

npm install expo-cli --global

节点和npm版本:

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\User\AppData\Roaming\npm-cache\_logs\2019-12-01T12_11_45_118Z-debug.log

根据官方网站,我正在尝试在Windows 10上安装expo-cli:

  

npm install expo-cli --global   我遇到以下错误:

43056详细Windows_NT 10.0.18362 43057详细argv“ C:\ Program Files \ nodejs \ node.exe”“ C:\ Program Files \ nodejs \ node_modules \ npm \ bin \ npm-cli.js”“安装”“ expo-cli”“ --global” 43058详细节点v12.13.1 43059详细npm v6.12.1 43060错误代码ELIFECYCLE 43061错误errno 1 43062错误envsub@3.1.0安装后:node --version v12.13.1 npm --version 6.12.1 43062错误退出状态1 43063错误envsub@3.1.0安装后脚本失败。 43063错误这可能不是npm的问题。上面可能还有其他日志记录输出。 43064详细出口[1,正确] 我正在使用python版本:

  

python --version   Python 3.8.0   以及节点和npm版本:

     

node --version   v12.13.1

     

npm --version   6.12.1   **   你有什么建议?

**

2 个答案:

答案 0 :(得分:19)

只需尝试在git bash上安装npm install expo-cli --global此命令。它对我有用。

答案 1 :(得分:1)

I fixed this problem

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

安装后脚本取决于内置的 unix shell 命令。因此,任何与unix shell兼容的shell都可以使用,例如 Git BASH

因此,在npm install expo-cli --global上进行上述安装后,运行Git BASH