Stack Exchange
TypeError: Cannot read property ':kyc' of undefined
node init.js
/home/root/init.js:16
    abiDefinition = JSON.parse(contract.contracts[':kyc'].interface);
                                                 ^

TypeError: Cannot read property ':kyc' of undefined
    at Timeout.afterDelay [as _onTimeout] (/home/root/init.js:16:50)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

Below is the init.js code
var web3 = require('web3');
fs = require('fs');
solc  = require('solc');

web3 = new web3(new web3.providers.HttpProvider("http://localhost:8545"));
code = fs.readFileSync('kyc.sol').toString();
contract = solc.compile(code);

function after2Delay() {
    contractInstance = kycContract.at(deployedContract.address);
    console.log(contractInstance.address);
}

function afterDelay() {
    abiDefinition = JSON.parse(contract.contracts[':kyc'].interface);
    byteCode = contract.contracts[':kyc'].bytecode;
    kycContract = web3.eth.contract(abiDefinition);
    deployedContract = kycContract.new({data: byteCode, from: web3.eth.accounts[0], gas: 4700000});
    setTimeout(after2Delay, 3000);
}

setTimeout(afterDelay, 8000);

