my code for migration is
type here
pragma solidity ^0.8.0;
contract UserRegistry {
mapping(address => bool) public registeredUsers;
event UserRegistered(address indexed user);
function registerUser() public {
require(!registeredUsers[msg.sender], "User already registered");
registeredUsers[msg.sender] = true;
emit UserRegistered(msg.sender);
}
function isUserRegistered(address user) public view returns (bool) {
return registeredUsers[user];
}
}
but when i try command npx truffle migrate –network development i am getting error
This version of µWS is not compatible with your Node.js build:
Error: Cannot find module ‘../binaries/uws_win32_x64_120.node’
Require stack:
- C:UsersTusharpeer-tutoring-networknode_modulesganachenode_modules@trufflesuiteuws-js-unofficialsrcuws.js
- C:UsersTusharpeer-tutoring-networknode_modulesganachedistnodecore.js
- C:UsersTusharpeer-tutoring-networknode_modulestrufflebuildmigrate.bundled.js
- C:UsersTusharpeer-tutoring-networknode_modulesoriginal-requireindex.js
- C:UsersTusharpeer-tutoring-networknode_modulestrufflebuildcli.bundled.js
Falling back to a NodeJS implementation; performance may be degraded.
Compiling your contracts…
Compiling .contractsUserRegistry.sol
Compiling .contractsUserRegistry.sol
Compilation warnings encountered:
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
–> project:/contracts/UserRegistry.sol
Artifacts written to C:UsersTusharpeer-tutoring-networkbuildcontracts
Compiled successfully using:
- solc: 0.8.21+commit.d9974bed.Emscripten.clang
Starting migrations…
Network name: ‘development’
Network id: 5777
Block gas limit: 6721975 (0x6691b7)
2_deploy_contracts.js
Replacing ‘UserRegistry’
*** Deployment Failed ***
“UserRegistry” hit an invalid opcode while deploying. Try:
- Verifying that your constructor params satisfy all assert conditions.
- Verifying your constructor code doesn’t access an array out of bounds.
- Adding reason strings to your assert statements.
Exiting: Review successful transactions manually by checking the transaction hashes above on Etherscan.
Error: *** Deployment Failed ***
“UserRegistry” hit an invalid opcode while deploying. Try:
- Verifying that your constructor params satisfy all assert conditions.
- Verifying your constructor code doesn’t access an array out of bounds.
- Adding reason strings to your assert statements.
at C:UsersTusharpeer-tutoring-networknode_modulestrufflebuildwebpack:packagesdeployersrcdeployment.js:330:1
Truffle v5.11.5 (core: 5.11.5)
Node v21.7.0
I am expesting the contract to run