I downloaded Web3js version 1.0.0 (https://github.com/ethereum/web3.js/releases), but
var version = web3.version.api;
alert(version);
I get 0.20.3 instead of 1.0.0
Why does it happen?
Thank you
I downloaded Web3js version 1.0.0 (https://github.com/ethereum/web3.js/releases), but
var version = web3.version.api;
alert(version);
I get 0.20.3 instead of 1.0.0
Why does it happen?
Thank you
I suspect you have two versions of web3js installed.
If you installed these npm, you can can check with npm --list | grep web3
Try uninstalling 0.20.3 like so: npm uninstall web3@0.20.3. If version 1.0.0 did not install properly the first time, npm -i web3@latest.
If you look through lib/web3.js, you will see..
var version = require('./version.json');
Now if we have a look at api
this.version = {
api: version.version
};
In this version.json you can see your version..
"version": "0.20.7"
Latest : https://github.com/ethereum/web3.js/blob/develop/lib/version.json
Take some time to investigate before asking as this isn't really a development question :)
Edit for clarification : What you downloaded was a release version.. These are different.. One is a library version, the other is like like a packages release version.