I’m encountering an issue when running npx hardhat node on my Windows machine. After setting up a new Hardhat project, attempting to start the node results in the following error:
Error HH604: Error running JSON-RPC server: The specified module could not be found.
\?C:testnode_modules@nomicfoundationedr-win32-x64-msvcedr.win32-x64-msvc.node
For more info go to https://hardhat.org/HH604 or run Hardhat with --show-stack-traces
Steps I’ve Taken:
Enabled Long Paths in Windows:
Modified the registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystemLongPathsEnabled and set it to 1.
Restarted the computer to apply changes.
Updated Node.js:
Upgraded to the latest Node.js 18.x LTS version.
Created a New Hardhat Project:
Initialized a new project using npx hardhat in an empty directory.
Installed Hardhat Locally:
Ran npm install –save-dev hardhat to ensure Hardhat is installed as a development dependency.
Reinstalled Project Dependencies:
Deleted node_modules and package-lock.json.
Executed npm install to reinstall dependencies.
Checked for Detailed Error Logs:
Executed npx hardhat node –show-stack-traces to obtain more information, but the same error persists without additional insights.
Environment Details:
Operating System: Windows 10
Node.js Version: 18.x LTS
Hardhat Version: 2.22.17
I’ve reviewed the Hardhat documentation on this error and explored related discussions, such as this GitHub issue, but haven’t found a solution that resolves my problem.
Question:
What additional steps can I take to resolve the HH604 error in Hardhat on Windows? Are there specific configurations or dependencies I should verify to address this issue?