3

in the web3 version 1.x docs: https://web3js.readthedocs.io/en/1.0/getting-started.html it says to install web 3 using

> npm install web3

but this installs version 0.2x.00.

so what should I do?

5

To view all versions of an npm package, enter npm view web3 versions. It'll list an array of all available version. To install a specific one, type npm install web3@versionNumber.

| improve this answer | |
2

run

sudo npm install -g web3@1.0

which will list all available versions: Valid install targets:

npm ERR! 1.0.0-beta2, 1.0.0-beta1, 1.0.0-beta.28, 1.0.0-beta.27, 1.0.0-beta.26, 1.0.0-beta.25, 1.0.0-beta.24, 1.0.0-beta.23, 1.0.0-beta.22, 1.0.0-beta.21, 1.0.0-beta.20, 1.0.0-beta.19, 1.0.0-beta.18, 1.0.0-beta.17, 1.0.0-beta.16, 1.0.0-beta.15, 1.0.0-beta.14, 1.0.0-beta.13, 1.0.0-beta.12, 1.0.0-beta.11, 1.0.0-beta.10, 1.0.0-beta.9, 1.0.0-beta.7, 1.0.0-beta.6, 1.0.0-beta.5, 1.0.0-beta.4, 1.0.0-beta.3, 1.0.0-beta.2, 1.0.0-beta.1, 0.20.4, 0.20.3, 0.20.2, 0.20.1, 0.20.0, 0.19.1, 0.19.0, 0.18.4, 0.18.2, 0.18.1, 0.18.0, 0.17.0-beta, 0.17.0-alpha, 0.16.0, 0.15.3, 0.15.2, 0.15.1, 0.15.0, 0.14.1, 0.14.0, 0.13.0, 0.12.2, 0.12.1, 0.12.0, 0.11.0, 0.10.0, 0.9.2, 0.9.1, 0.9.0, 0.8.1, 0.8.0, 0.7.1, 0.7.0, 0.6.0, 0.5.0, 0.4.3, 0.4.2, 0.4.1, 0.4.0, 0.3.6, 0.3.4, 0.3.3, 0.3.2, 0.3.1, 0.3.0, 0.2.8, 0.2.7, 0.2.6, 0.2.5

choose the most updated. or other if you have any reference. then u can run

sudo npm install web3@1.0.0-beta.28
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.