0

I want to install webjs so I run the below command but it is showing an error.

$ sudo npm install -g web3

npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/web3-js/WebSocket-Node.git
npm ERR! enoent 
npm ERR! enoent 
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nithin/.npm/_logs/2019-09-18T09_41_14_857Z-debug.log
4
  • Try this: open the packge-lock.json file which was created where you've just executed that npm install command, search for WebSocket in it, and change http://github.com to git://github.com Commented Sep 18, 2019 at 9:54
  • there is no WebSocket inside packge-lock.json file
    – Darshan
    Commented Sep 18, 2019 at 9:58
  • Which OS are you using? From the error message it seems you lack the git command.
    – Ismael
    Commented Sep 18, 2019 at 16:17
  • I am using ubuntu OS
    – Darshan
    Commented Sep 19, 2019 at 4:50

1 Answer 1

2

I am expecting that you already executed npm init at first.

I assume you are using windows? I always develop blockchain related stuff on Ubuntu.

Here is what you need to do on windows to set it up properly.

Step 1: npm install -g --production windows-build-tools

Step 2: npm install -g node-gyp

Now it should work!

If you still have a problem make sure that your git is installed globally and accessible.

3
  • The log shows slashes / as path separator so it can't be native Windows, so it is Linux or Macos and there installing windows-build-tools doesn't work.
    – Ismael
    Commented Sep 18, 2019 at 16:27
  • 1
    @Ismael thanks for pointing that out. I have already mentioned the other solution to this problem. For the sake of completeness I will leave the other info for windows users.
    – cqx
    Commented Sep 18, 2019 at 17:27
  • 1
    @NiklasFeurstein, I am using using ubuntu OS
    – Darshan
    Commented Sep 19, 2019 at 4:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.