Web3.js: Web3 not installing correctly. using "npm install web3", "npm install web3 -latest

Created on 9 Mar 2018  路  11Comments  路  Source: ChainSafe/web3.js

Most helpful comment

The problem with web3@^0.20.0 and probably with other versions earlier than web3@^1.0.0-beta.36 is that modules like web3.utils necessary for getting balances, building transactions etc. don't seem to work or perhaps even exist, so installing the 0.20.0 version doesn't really solve the problem. I am not 100% sure, but it seems that running npm install --global --production windows-build-tools from Windows PowerShell (as an ADMIN!) and then installing web3@^1.0.0-beta.36 is the only way.

All 11 comments

192-168-1-109:~ connor$ npm install web3@^1.0.0
npm ERR! code ETARGET
npm ERR! notarget No matching version found for web3@^1.0.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/connor/.npm/_logs/2018-03-09T07_22_40_901Z-debug.log
192-168-1-109:~ connor$ npm install web3
npm WARN deprecated [email protected]: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.[email protected]: 鈿狅笍 WARNING 鈿狅笍 tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar

[email protected] install /Users/connor/node_modules/web3-providers-ws/node_modules/websocket
(node-gyp rebuild 2> builderror.log) || (exit 0)

CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/bufferutil.node
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/validation.node
npm WARN connor No description
npm WARN connor No repository field.
npm WARN connor No license field.


192-168-1-109:~ connor$ npm install web3 latest
npm WARN [email protected] had bundled packages that do not match the required version(s). They have been replaced with non-bundled versions.
npm WARN connor No description
npm WARN connor No repository field.
npm WARN connor No license field.


192-168-1-109:~ connor$ npm install ethereum/web3.js -save
npm WARN connor No description
npm WARN connor No repository field.
npm WARN connor No license field.

  • [email protected]
    added 5 packages from 7 contributors and updated 1 package in 223.995s

Can you clarify what exactly isn't working correctly? Other than the time you installed a package called latest it appears to have worked right in each case?

You do appear to be running npm install inside your home directory, which doesn't seem like it is what you intended.

problem is solved!
just did a restart and it was working fine.
thanks!

the problem was web3 not connecting to a node console and not allowing me to interact with it

Great to hear. Go ahead and close this issue then. :+1:

The problem with web3@^0.20.0 and probably with other versions earlier than web3@^1.0.0-beta.36 is that modules like web3.utils necessary for getting balances, building transactions etc. don't seem to work or perhaps even exist, so installing the 0.20.0 version doesn't really solve the problem. I am not 100% sure, but it seems that running npm install --global --production windows-build-tools from Windows PowerShell (as an ADMIN!) and then installing web3@^1.0.0-beta.36 is the only way.

The problem with web3@^0.20.0 and probably with other versions earlier than web3@^1.0.0-beta.36 is that modules like web3.utils necessary for getting balances, building transactions etc. don't seem to work or perhaps even exist, so installing the 0.20.0 version doesn't really solve the problem. I am not 100% sure, but it seems that running npm install --global --production windows-build-tools from Windows PowerShell (as an ADMIN!) and then installing web3@^1.0.0-beta.36 is the only way.

I am having the same problem. My application shows that it is using 0.20.7 version and i can't get some very important functions to work while i have installed latest version on my system and in the project directory too, even in the package json file and in other dependencies it's ^1.2.1 but still my application is using 0.20.7. I can't understand why and can't resolve it.

@saadibrahimiv eventually you have got a package-lock.json file in your directory which you need to delete?

@saadibrahimiv eventually you have got a package-lock.json file in your directory which you need to delete?

getpastevent_query
still getting the same web3 version

@saadibrahimiv

You might find this Metamask gist to instantiating Web3 helpful.

@saadibrahimiv

You might find this Metamask gist to instantiating Web3 helpful.

I solved it by using cdn in my html.

Was this page helpful?
0 / 5 - 0 ratings