medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Unable to run Medusa due crytic-compile error, corrupted lockfile due to NPM bug

Open ljz3 opened this issue 2 years ago • 5 comments

I am unable to run medusa due to encountering the issue:

⇾ Reading the configuration file at: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa/medusa.json
⇾ Compiling targets with crytic-compile
error Failed to compile target
‣ error while executing crytic-compile:
        OUTPUT:
        INFO:CryticCompile:'npx hardhat clean' running (wd: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa)
        INFO:CryticCompile:'npx hardhat clean --global' running (wd: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa)
        INFO:CryticCompile:'npx hardhat compile --force' running (wd: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa)
        ERROR:CryticCompile:'npx' returned non-zero exit code 1
        ERROR:CryticCompile:Error HH18: You installed Hardhat with a corrupted lockfile due to the NPM bug #4828.
        stderr: 
        stderr: Please delete your node_modules, package-lock.json, reinstall your project, and try again.
        stderr: For more info go to https://hardhat.org/HH18 or run Hardhat with --show-stack-traces
        ERROR:CryticCompile:Compilation failed. Can you run build command?
        /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa/artifacts/build-info is not a directory.

        ERROR: exit status 255

This is on a minimal hardhat repository created with npx hardhat init.

Installation steps I went through:

  • Downloaded MacOS binary through https://github.com/crytic/medusa/releases
  • Placed binary file into /usr/local/bin
  • Ran pip3 install crytic-compile
  • Ran medusa init
  • Ran medusa fuzz

Environment info: OS: MacOS V14.2, Chip: M2 max node -v: 18.17.0 npm -v: 9.6.7 pip3 --version: 23.3.1

ljz3 avatar Nov 20 '23 23:11 ljz3

Can you reproduce just running crytic-compile .?

gustavo-grieco avatar Nov 21 '23 07:11 gustavo-grieco

Hello @ggrieco-tob, thank you for the response.

I ran crytic-compile . on the same repo, and it seems that the command ran successfully with logs:

crytic-compile .

INFO:CryticCompile:'npx hardhat clean' running (wd: /Users/kevinli/Desktop/All/PersonalCoding/testing/hardhat-medusa)
INFO:CryticCompile:'npx hardhat clean --global' running (wd: /Users/kevinli/Desktop/All/PersonalCoding/testing/hardhat-medusa)
INFO:CryticCompile:'npx hardhat compile --force' running (wd: /Users/kevinli/Desktop/All/PersonalCoding/testing/hardhat-medusa)

ljz3 avatar Nov 21 '23 12:11 ljz3

It seems that this issue is specific to medusa, thanks for confirming that. @anishnaik will take care

gustavo-grieco avatar Nov 21 '23 16:11 gustavo-grieco

Appears that this is an issue with the release binary, building it from source works.

ljz3 avatar Nov 25 '23 18:11 ljz3

@ljz3 thanks for the additional details. Will look more into this this week.

anishnaik avatar Nov 27 '23 00:11 anishnaik

	"compilation": {
		"platform": "crytic-compile",
		"platformConfig": {
			"target": ".",
			"solcVersion": "",
			"exportDirectory": "",
			"args": [
				"--compile-force-framework",
				"foundry",
				"--foundry-compile-all",
				"--foundry-out-directory",
				"forge-artifacts"
			]
		}
	},

Similar issue here.

Screenshot 2024-12-20 at 4 02 08 PM

hexshire avatar Dec 20 '24 19:12 hexshire