Fix detection of node_modules/ in monorepos
0xalpharush opened this issue · 5 comments
We need a way to find node_modules for monorepo that is more robust
This is especially sticky for monorepo projects where something like @openzeppelin/*
is not installed in the relative node_modules/
but in the root workspace. Yarn 2 removed nohoist as well, so I haven't really found a good solution to this yet.
A temporary workaround is to symlink the relevant packages into the relative/workspace's node_modules/
dir but that gets pretty annoying and is temporary.
ETA: A solution is adding the following to the package.json
for the contract package:
"installConfig": {
"hoistingLimits": "dependencies"
},
Originally posted by @mikeshultz in crytic/slither#852 (comment)
Currently trying to work on this issue, just wanted to clarify if the fix would be platform dependent and if so should it support all the platforms?
Is there any progress on this? It would be really useful to support monorepos / custom node_modules
paths.
This could be solved adding a flag and one more elif
at this point: https://github.com/crytic/crytic-compile/blob/master/crytic_compile/utils/naming.py#L109, allowing to customize where node_modules
is.
Hi, this issue is still prevalent. I got this error while trying to run my fuzz tests with echidna in a monorepo contract.
Tried the given solutions to no avail.
Any help would be appreciated.
@asmitadhungana Would you be able to open an issue and provide more detail on your setup and what command you ran please? It'd be helpful if you could share the code as well