How to check installed web3 version with command line terminal?
5 Answers
From a command line: npm ls web3 or npm list web3.
By the way, this message has nothing to do with web3, it's telling you to upgrade npm itself.
- thanx @goodvibration my problem solved upgrading npmIshwar– Ishwar2018-08-03 18:53:12 +00:00Commented Aug 3, 2018 at 18:53
npm install web3 installs web3.js, which has a version command documented here: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi
var version = web3.version.api; console.log(version); // "0.2.0" - 2Or just
npm ls web3goodvibration– goodvibration2018-06-12 06:03:43 +00:00Commented Jun 12, 2018 at 6:03 - shows different version than package.jsonEddie– Eddie2019-02-28 22:41:12 +00:00Commented Feb 28, 2019 at 22:41
You can check your node module versions using:
npm view <module> version So just type on your terminal:
npm view web3 version You may by the following:
Step-I: on your console write "node" and then enter
~/../currentDir> node Then:
>var Web3 = require("web3"); >console.log(Web3.version); Output:
'1.2.11' //version
web3, it's telling you to upgradenpmitself.npmno web3