Hot answers tagged


This web3 version is a few years old you should probably use a new one. Make sure to update!


Get the contract object via: const contract = await new web3.eth.Contract(JSON.parse(interface), smartContractAddress);


If using a recent web3 (e.g. 1.0.0-beta.50), a possible remedy is to set esModuleInterop: { "compilerOptions": { "esModuleInterop": true } } See also:


I am expecting that you already executed npm init at first. I assume you are using windows? I always develop blockchain related stuff on Ubuntu. Here is what you need to do on windows to set it up properly. Step 1: npm install -g --production windows-build-tools Step 2: npm install -g node-gyp Now it should work! If you still have a problem make sure ...


Your version of Python does not match the required version for one of the dependencies. To explain your error in more detail, Python is not compiled, so version mismatch is found at run-time. The program is using the old Python 2.7 print syntax which is flagging the error. By installing the appropriate version of Python 2.7 or upgrading to a version of the ...


There is an alternative method. You can download ganache from the below link $ After it has downloaded execute the below command in terminal $cd Downloads $sudo chmod a+x ganache-1.2.2-x86_64.AppImage Now search for ganache and double click on it and press yes ...


I guess it is not compatible with node 12.x I managed to install it with node 10.16.0 I also had to install the following to solve some error messages: sudo apt-get install libgconf-2-4 sudo apt install libcanberra-gtk-module libcanberra-gtk3-module


uninstall / reinstall node (deleted all related folders in local directories too, including in Roaming) in POWERSHELL as Administrator: npm install --global --production windows-build-tools npm install --save --no-optional web3. Hope this works for you.


Not sure (because you didn't provide full error logs), but I think the problem is with some build-tools, installing it will solve your problem. npm install -g windows-build-tools Note: Make sure that you install windows-build-tools globally.

Only top voted, non community-wiki answers of a minimum length are eligible