lydell / eslump

Fuzz testing JavaScript parsers and suchlike programs.
MIT License
57 stars 6 forks source link

Cannot find module './test.js' #7

Closed aladdin-add closed 5 years ago

aladdin-add commented 5 years ago
$ eslump ./test.js output

it reports Cannot find module './test.js' -- since./test.js is a file, not a package.

I can make a repo to reproduce later(if needed).

background: I was trying to use it in cherow.

lydell commented 5 years ago

Did you create ./test.js first?

aladdin-add commented 5 years ago

yes, I did. here is a repro: https://github.com/Aladdin-ADD/eslump-issue7

image

lydell commented 5 years ago

Thanks. First, you need the ./ since it is a local file and not a package in node_modules. But even with eslump ./cherow.js output I got the error. I have almost exclusively run the CLI directly in the eslump repo so I haven’t noticed :) I think the issue is that the CLI tries to require("./cherow.js") relative to itself, not relative to CWD.

lydell commented 5 years ago

For now, you can clone this repo and run the bundled cherow example. It might be a bit outdated, though.

lydell commented 5 years ago

Fixed in v2.0.0