9

Installation Environment

win7 64bit

I:\nodejs>node -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

I have never encountered such a problem, and I have not found any clues on google.

TylerH
  • 20,799
  • 66
  • 75
  • 101
pangjiale
  • 145
  • 1
  • 1
  • 10

6 Answers6

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

Those lines tells you that the problem is the missing git. Here is your solution.

lependu
  • 1,160
  • 8
  • 18
6

Just install the git your problem will be solve. npm try to download using git

codingclues
  • 169
  • 2
  • 4
2

If you have git installed then make sure it's accessible globally by just typing git in command prompt.

If you don't see list of git commands then you have to configure your GIT path in windows under environment variable section.

Check this for more detail

Hardik Raval
  • 3,406
  • 1
  • 26
  • 28
1

I solved it like this:

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

step2 npm install --global node-gyp

pangjiale
  • 145
  • 1
  • 1
  • 10
1

If this thing happened inside your docker container, you can fix it by adding the following lines to you Dockerfile

RUN apk add --no-cache git

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

0

undefined ls-remote -h -t git... can occure if you try to install node modules in windows power shell. Try using git bash instead