First, I install type to the code like npm install web3
in the terminal while the first issue occurs (Environment1).Second, I change the version of node
、npm
(like Envirnment 1=> Environment2) and type to the same code npm install web3
is OK (version of web3
is 0.20.6 ). Last, when I invoke web3.eth.methods in my project(Environment2 ),I found the second issue is occuring that this.web3
is defined but the this.web3.eth.methods
is undefined in despite of I configure the environment 2 through npm install web3
or yarn add web3
.
Environment1 system:Ubuntu16.04; node:8.9.0; npm:5.6.0;
Issue 1 as fellow
the issue describe like /.npm/_cache/tmp/git-clone-da91fc96/.git:Permission denied
Environment2 system:Ubuntu16.04; node: 6.11.0; npm: 3.11.0; web3: 0.20.6;
Issue 2 as fellow
I type to the code like console.log(this.web3
) in project and test through developer tool in Google ,the picture as fellow:
I invoke the contract through var Contract = new this.web3.eth.contract(artifacts.abi,'contract_address');
print the contract in project and test through developer tool in Google ,the picture as fellow:
And I invoke a method like getValue()
is undefined and I type to the code console.log(window.escrowContract.methods);
display the methods is undefined as fellow:
I don't know whether relationship has between two issue and I look through some articles and tutorials ,their methods don't work on me .And I know the version of web3 under the version1 (https://web3js.readthedocs.io/en/1.0/web3-eth.html) ,the method of invoke contract should be var Contract = new this.web3.eth.Contract(artifacts.abi,'contract_address');
.But a new issue occurs as fellow ,so I change the C
into c
.
What's the method can resolve it ?