zak100 Posted December 20, 2020 Share Posted December 20, 2020 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 More sharing options...
fiveworlds Posted December 21, 2020 Share Posted December 21, 2020 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 1 Link to comment Share on other sites More sharing options...
zak100 Posted December 25, 2020 Author Share Posted December 25, 2020 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 More sharing options...
zak100 Posted December 26, 2020 Author Share Posted December 26, 2020 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now