Jump to content

Installing web3 on Ubuntu 18.04


zak100
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

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.