Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes

TypeError: web3_1.default is not a constructor

If using a recent web3 (e.g. 1.0.0-beta.50), a possible remedy is to set esModuleInterop: { "compilerOptions": { "esModuleInterop": true } } See also: https://github.com/ethereum-ts/...
Eron Wright's user avatar
5 votes

Help Please Solidity version pragma statement in these files doesn't match the configured compilers in your config*contracts/hello-world.sol ("0.8.4")

try this: at hartdhat.config.js module.exports = { solidity: "0.7.1", }; 0.7.1--> 0.8.4 (solidity version you use in the smart contract) if not work, comment below, or git upload code ...
aakash4dev's user avatar
5 votes
Accepted

Not getting getPastEvents or once function using contract instance

This web3 version is a few years old you should probably use a new one. Make sure to update!
cqx's user avatar
  • 3,462
4 votes
Accepted

Load Smartcontract in Nodejs

Get the contract object via: const contract = await new web3.eth.Contract(JSON.parse(interface), smartContractAddress);
cqx's user avatar
  • 3,462
3 votes

Help Please Solidity version pragma statement in these files doesn't match the configured compilers in your config*contracts/hello-world.sol ("0.8.4")

it needs to match up with what's in module.exports in your hardhat.config.js but the quotes in the contract are causing the problem try this pragma solidity ^0.8.4;
sola24's user avatar
  • 1,238
3 votes
Accepted

Ganache GUI installation error

There is an alternative method. You can download ganache from the below link $https://github.com/trufflesuite/ganache/releases/download/v1.2.2/ganache-1.2.2-x86_64.AppImage After it has downloaded ...
Nithin TD's user avatar
  • 153
3 votes
Accepted

Linux: node-gyp installation woes in scrypt package

Looking at the comments, two ideas were mentioned: I was running Node v12, and @Jay suggested downgrading to v11, and @Ismael suggested that the fail could be triggered by importing a web3 <1.2.9. ...
The Renaissance's user avatar
3 votes

hardhat-shorthand is not working

Found the solution: Instead of yarn, use npm or npx for installing. Use npm install --global hardhat-shorthand Instead of yarn global add hardhat-shorthand Hardhat team mentions something similar in ...
Raushan Sharma's user avatar
3 votes

hardhat-shorthand is not working

yarn won't complain if it can't install some components as a result of a lack of administrator privileges. Try doing the installation as root and it should work. sudo yarn global add hardhat-shorthand
Ramon Royo's user avatar
2 votes
Accepted

Error while installing web3

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 ...
Peteris's user avatar
  • 1,005
2 votes
Accepted

Not able to interact with Ganache-cli: "-bash: ganache-cli: command not found"

You should (almost) never use sudo with npm. Once you do so the folders and files npm touches/creates are now locked to the root user only. The simplest solution is to do sudo rm -rf node_modules for ...
David Murdoch's user avatar
2 votes

Can't install Truffle Framework to Mac OS Big Sur

I manage to make it by installing HomeBrew first you can get this at this link: https://brew.sh/ You will have to type this before you start using brew command export PATH="/opt/homebrew/bin:$...
Jia Xing's user avatar
2 votes

npm throw errors when installing dependencies of hardhat

Hardhat migrated waffle plugin to the chai detailed info here https://hardhat.org/hardhat-runner/docs/guides/migrating-from-hardhat-waffle#migrating-away-from-hardhat-waffle
s3f4's user avatar
  • 21
2 votes

Web3 js installation error

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 ...
cqx's user avatar
  • 3,462
1 vote
Accepted

Is it okay to make "OpenZeppelin contracts" a dev dependency in my React app?

Short answer It's probably safe. It depends on how you structured your contract build step, but odds are you'll be fine. Long answer The question really boils down to "what's the difference ...
Ziyad Edher's user avatar
1 vote

npm throw errors when installing dependencies of hardhat

npm install --save-dev hardhat npx hardhat npm install --save-dev @nomicfoundation/hardhat-toolbox npx hardhat test or compile don’t use npm install --save-dev @nomiclabs/hardhat-waffle ethereum-...
Aritra Sen's user avatar
1 vote

Unable to install Truffle - Warn and Error

had this same problem, but when I tried to run the windows-build-tools, it just gost stucked. Tried a few times and instead of trying to do the installation via Chocolatey, I just ignored it (since it ...
Carolina Pereira's user avatar
1 vote

Unable to install npm truffle - WARN deprecated

No need to worry. This is not a failure message but just some warnings. If you get errors, something went wrong. Truffle will work just fine. You can verify that the installation was successful with ...
GongFu's user avatar
  • 153
1 vote
Accepted

SyntaxError: await is only valid in async function

You need change the fallback method inside beforeEach to be an async method as follows: beforeEach(async() => { // Get list of all accounts accounts = await web3.eth.getAccounts(); // ...
Ahmed Ihsan Tawfeeq's user avatar
1 vote

Connect Typescript dependency with Solidity contract

I use 0xWeb to generate typescript classes to access the blockchain directly $ npm i 0xweb -g $ 0xweb init $ 0xweb install 0xab33e884ec8fed4f5867246e4300228f3d666561 --name dydx/oasis-matching-...
tenbits's user avatar
  • 2,438
1 vote

Connect Typescript dependency with Solidity contract

In our project we used typechain
Stefdelec's user avatar
1 vote

Cannot install truffle. Node.js and npm are installed

Tried upvoting @Praktisch's answer, but I don't have enough reputation yet. npx worked for me. I had the same problem. Switched from zsh to bash. Added folders to execution path. No luck. If I ...
ksfowler's user avatar
1 vote

Cannot install truffle. Node.js and npm are installed

try npx truffle init after you install npm and truffle
Praktisch's user avatar
1 vote

Truffle not working after install using npm

I had this issue as well, the problem is the nodejs version. Updating to v15.11.0 and reinstalling Truffle should fix it.
JordyAlkema's user avatar
1 vote

Can't install Truffle Framework to Mac OS Big Sur

Try "brew install truffle" It worked for me.
Praveen Kumar's user avatar
1 vote

Can't install Truffle Framework to Mac OS Big Sur

You are running into permission issues. MacOS is a Linux based operating system. Linux based operating systems require administrative privileges to make editorial changes to root directories. On MacOS ...
Karl Schmidt's user avatar
1 vote
Accepted

Problem with installing web3 on ubuntu 18.04 using npm

Try to install web3, without "-g", just npm install web3 (like the package states) -g is used to have the command available in all directories, but you will only need web3 in your client ...
Alexander Herranz's user avatar
1 vote

npm ERR! code ENOENT npm ERR! syscall spawn git

I already install git in my computer. However, I forget to set it to environment variables. After I set it, the error disappeared and unboxed react successfully. The solution of this error is to set ...
Jessie's user avatar
  • 161
1 vote

Ganache GUI installation error

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 ...
Gerard Persoon's user avatar
1 vote

Issue with the "npm install drizzle" command on Windows

As mentioned here, "npm install drizzle is no longer supported, it's now npm install @drizzle/store." Also, Make sure you clear cache using npm cache clean --force.
Badr Bellaj's user avatar
  • 18.8k

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