When I tried to use your both of your instruction, I have error mgs depends on the version of web3js
If I used v0.20 I have: TypeError: web3.eth.contract is not a function
If v1.00-beta.55:
TypeError: web3.eth.contract is not a constructor
at Object. (/home/usr/go/src/github.com/hyperledger/web3-fabric-voting-dapp/server.js:20:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
This error I have after npm -install & npm -start
And I changed VoteContract = new web3.eth.contract(abi) for web3 v 1.0