【问题标题】:npm install web3 Install fails: undefined ls-remotenpm install web3 安装失败: undefined ls-remote
【发布时间】:2019-04-14 07:15:17
【问题描述】:

安装环境

win7 64位

I:\nodejs>节点-v

v10.13.0

I:\nodejs>npm -v

6.4.1

I:\nodejs>npm install web3

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your appli
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2018-11-11T09_18_45_834Z-debug.log

我从来没有遇到过这样的问题,在google上也没有找到任何线索。

提前致谢

【问题讨论】:

    标签: node.js installation web3


    【解决方案1】:
    npm ERR! code ENOGIT
    npm ERR! Error while executing:
    npm ERR! undefined ls-remote -h -t git://github.com/frozeman/WebSocket-Node.git
    npm ERR!
    npm ERR! undefined
    npm ERR! No git binary found in $PATH
    npm ERR!
    npm ERR! Failed using git.
    

    这些行告诉您问题是缺少gitHere 是您的解决方案。

    【讨论】:

      【解决方案2】:

      只需安装 git 即可解决您的问题。 npm 尝试使用 git 下载

      【讨论】:

        【解决方案3】:

        如果您安装了 git,则只需在命令提示符中键入 git 即可确保它可以全局访问。

        如果您没有看到 git 命令列表,那么您必须在 Windows 中的 environment variable 部分下配置您的 GIT 路径。

        Check this for more detail

        【讨论】:

          【解决方案4】:

          我是这样解决的:

          step1 npm install --global --production windows-build-tools

          step2 npm install --global node-gyp

          【讨论】:

            【解决方案5】:

            如果这件事发生在您的 docker 容器中,您可以通过向您添加以下行来修复它Dockerfile

            RUN apk add --no-cache git
            

            来源: https://medium.com/anna-coding/solution-for-npm-err-enoent-undefined-ls-remote-h-t-18ab6f8274af

            【讨论】:

              猜你喜欢
              • 2017-12-03
              • 2019-02-07
              • 2016-12-12
              • 2018-05-10
              • 1970-01-01
              • 2020-06-08
              • 2016-06-12
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多