Jump to content

Featured Replies

Hi,

I have installed nodejs on my ubuntu machine.

I am trying to install web3 on my ubuntu 18.04 system. I am using the following command:

@lc2530hz:~$ sudo npm install -g web3

but I am getting the error:

sudo: npm: command not found

But when I am typing: @lc2530hz:~$ npm --version 6.14.6

Kindly guide me how to install web3.

I have got some solution here:

https://askubuntu.com/questions/1301489/problem-with-installing-web3-using-npm

But I don't know how to implement it. Somebody please guide me.


 

 

Zulfi.

 

You should be using the latest ubuntu for a start as 18.04 is unsupported. NVM can be used to install the latest npm which will be able to install web3.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \. "$NVM_DIR/bash_completion"
nvm install node
npm install -g web3


image.thumb.png.9cd16ffa483e18070c43cb37c56492b5.png

 

  • Author

Hi,

Can you please show me your results for "npm install web3"? They say that 'g' is used for global installation. I got following:

$ nvm install node
Downloading and installing node v15.5.0...
Downloading https://nodejs.org/dist/v15.5.0/node-v15.5.0-linux-x64.tar.xz...
######################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v15.5.0 (npm v7.3.0)
zulfi@lc2530hz:~$ npm install web3

removed 1 package, and audited 353 packages in 1s

1 low severity vulnerability

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
zulfi@lc2530hz:~$


I can't remove this problem:

reddit web_js installation

Please guide me how to get rid of this low severity error?

Also have you tried to run smart contracts after installing web3.nodejs with -g option?

Zulfi.

  • Author

Hi @fiveworlds,

Thanks a lot for solving my problem. God blesses you. You are right, it was related to Python:

I pressed Alt-F12, to go into the terminal mode and then installed the web3.py using the following command.

python3 -m pip install web3

 

 

Zulfi.

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.