I tried to install web3 in my mac by using sudo npm install web3 but failed many a times . Please help me to sort this matter out . i am attaching you the exact error that I am facing while running above command.enter image description here

1 Answer 1


This is a Node question more so.

But most likely your issues lies here:

no such file or directory, open '/Users/saitejakuruva/package.json'

You're not in a proper project directly when calling npm install. NPM was trying to write to, or update, the package.json file.

Try npm install -g web3 which will install web3 at a global level available to all projects.

This may go against best practices elsewhere per project, so be aware.


Link to fixing permission issues with Mac and NPM: https://stackoverflow.com/questions/47252451/permission-denied-when-installing-npm-modules-in-osx/47252840

  • So sorry. I tried using the command suggested by you but I facing the same issue. Please find the details of the issue here i.imgur.com/PZgZkDH.png Mar 19, 2019 at 19:18
  • Well, it's a small step in the right direction. No longer is the package.json error showing. But it's still an access permissions error when creating new directories. Please read this post: stackoverflow.com/questions/47252451/… Does that help? Mar 19, 2019 at 19:23
  • It doesn't work for me again getting the same error. :( Mar 19, 2019 at 19:58
  • how about yarn global add web3 ? Mar 19, 2019 at 20:43
  • What is this? I'm unable to understand this can you please explain me in detail please Mar 19, 2019 at 20:50

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.