I want to connet my meteor localhost to ropsten testnet. Therefore i have a lib.js with the connecting commands:

//var Web3 = require('web3'); if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { // set the provider you want from Web3.providers web3 = new Web3(new Web3.providers.HttpProvider("http://ropsten.infura.io/..."));
if(!web3.isConnected()) console.log("not connected"); else console.log("connected"); }

A time out msg appears. I read about the var Web3 = require('web3'); But when i add this line i also get a error msg for missing modules. How can i get this run?

1 Answer 1


You need to install Web3, and add the

var Web3 = require('web3');

  • it solved the problem, but now i get web3.isConnected is not a function. I got the 1.0.0 beta version of web3
    – TimRicta
    Commented Sep 26, 2017 at 11:20
  • Please remove your private infura key from your last comment. Also, try if( false === web3.isConnected())
    – n1cK
    Commented Sep 26, 2017 at 13:20
  • also i added console.log(web3.currentprovider) after new web3 and i get <code>HttpProvider {host: "ropsten.infura.io/...";, timeout: 0, connected: false} connected : false host : "ropsten.infura.io/..."; timeout : 0 proto : Object</code>
    – TimRicta
    Commented Sep 27, 2017 at 8:00
  • so looks like ropsten won't let you connect ?
    – n1cK
    Commented Sep 29, 2017 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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