Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardhat disallows global installation npx hardhat compiile --force #901

Closed
Pet3ris opened this issue Jul 28, 2021 · 4 comments
Closed

Hardhat disallows global installation npx hardhat compiile --force #901

Pet3ris opened this issue Jul 28, 2021 · 4 comments

Comments

@Pet3ris
Copy link

Pet3ris commented Jul 28, 2021

It seems that Hardhat now disallows compilation from a global installation (https://hardhat.org/errors/#HH12).

This is what I'm getting when running npx hardhat compile --force on a local Hardhat project:

Error HH12: Trying to use a non-local installation of Hardhat, which is not supported.
Please install Hardhat locally using npm or Yarn, and try again.

It seems that slither is using this as a default setting. Any ideas for a workaround other --hardhat-ignore-compile?

@ggrieco-tob
Copy link
Member

I'm always using a local installation to run slither, usually like this:

$ npm i
$ PATH=$PATH:./node_modules/.bin slither .

@Pet3ris
Copy link
Author

Pet3ris commented Jul 28, 2021

Does this mean slither is globally installed or in your active python environment? I was running this from a mono repo with a protocol folder (hardhat) and a python folder for the slither-analyzer dependency managed by poetry.

@Pet3ris
Copy link
Author

Pet3ris commented Jul 28, 2021

I just tried installing it in the local virtual environment and running like so:

slither .

However, I'm still getting the following output:

'npx hardhat compile --force' running

@montyly
Copy link
Member

montyly commented Aug 6, 2021

Hi @Pet3ris, you are right, and it seems that hardhat does not work anymore with global installation, so npx is not useful anymore, thanks for pointing this out.

I am moving the discussion to crytic/crytic-compile#208. A quick workaround is to use --npx-disable

@montyly montyly closed this as completed Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants