I got a problem. I am using code below to connect to the eth from node.js app. Everything works perfect as long as I have installed MetaMask in my browser. I can be logged in, logged out, all good when I fetch the data. Problems comes when I uninstall MetaMask. It writes, that currentProvider is undefined. Is there a workaroud? What am I doing wrong?
System: Windows '' Browsers: Brave, Chrome, Opera (havent tried others) Node version: 8.12. web3 version: 1.0.0-beta.46
import Web3 from 'web3';
var web3;
if (typeof window !== 'undefined' && window.web3 !== 'undefined') {
web3 = new Web3(window.web3.currentProvider);
} else {
const provider = new Web3.providers.HttpProvider('https://rinkeby.infura.io/v3/...' );
web3 = new Web3(provider);
}
export default web3;