title: web3.js: function web3.eth.Contract(abi, address) failed to initiate a contract instance
body: <p>I am trying to interact with a smart contract deployed on a local Ethereum node under the help of web3.js library. Unfortunately, <code>web3.eth.Contract(abi, address)</code> seems to fail in initiating a contract instance.</p>
  
  <hr>
  
  <p>【Snippits】The entire <code>app.js</code> file shows as below:</p>
  
  <pre><code>const Web3 = require('web3');
  const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
  
  const abi = [{"anonymous": false,"inputs": [{"indexed": false,"name": "add","type": "int256"},{"indexed": false,"name": "name","type": "string"},{"indexed": true,"name": "id","type": "uint256"},{"indexed": true,"name": "checked","type": "bool"}],"name": "globalValueChanged","type": "event"},{"constant": false,"inputs": [{"name": "add","type": "int256"},{"name": "name","type": "string"},{"name": "id","type": "uint256"},{"name": "checked","type": "bool"}],"name": "modifyGlobalValue","outputs": [{"name": "","type": "int256"}],"payable": false,"stateMutability": "nonpayable","type": "function"},{"inputs": [],"payable": false,"stateMutability": "nonpayable","type": "constructor"},{"constant": true,"inputs": [],"name": "getGlobalValue","outputs": [{"name": "","type": "int256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": true,"inputs": [{"name": "times","type": "int256"}],"name": "testGlobalValue","outputs": [{"name": "","type": "int256"}],"payable": false,"stateMutability": "view","type": "function"}]
  const address = '0x9f6c4e63cbca51dea852a579c907317a0eac138c';
  const contractInstance = new web3.eth.Contract(abi, address);
  
  // to test if initialized web3 works fine
  web3.eth.getAccounts().then((results) =&gt; {
      console.log("***web3.eth.getAccounts()***:")
      console.log(results)
  })
  
  // to test if web3.eth.Contract works
  console.log("***contractInstance.abi***:")
  console.log(contractInstance.abi)
  </code></pre>
  
  <hr>
  
  <p>【Outputs】Outputs of running <code>node app.js</code>. </p>
  
  <pre><code>**contractInstance.abi***:
  undefined
  ***web3.eth.getAccounts()***:
  [ '0x135B02baD443C1073C14F8a7f13cEc8661d3eC3d',
    '0x69890d19B6eb060cA47e1ca41d93256E46bb7195' ]
  </code></pre>
  
  <p>The <code>web3.eth.getAccounts()</code> returns correct values, while <code>web3.eth.Contract(abi, address)</code> seems to fail to initiate a contract instance. </p>
  
  <hr>
  
  <p>【Addtional Information】</p>
  
  <ol>
  <li><p><code>npm list web</code> outputs <code>web3@1.0.0-beta.52</code>.</p></li>
  <li><p>Other web3 functions like web3.eth.getAccounts() works fine.</p></li>
  <li><p>In geth console, with the same value of <code>abi</code> and <code>address</code>, <code>eth.contract(abi).at(address)</code> works fine.</p></li>
  </ol>