HI EVERYONE!

The last year I have always used truffle, the last few days I wanted to try hardhat but since I am trying I can't do anything because I always get the error "zsh: command not found: hardhat".

I am using:
MacBook Pro (M1, 2020)
macOS Monterey V12..2.1
node 16.6.0
nvm 0.39.1

I already tried reinstalling hardhat, node, nvm, and modifying the .zshrc file as expressed on https://stackoverflow.com/questions/12743928/command-not-found-after-npm-install-in-zsh

but nothing works so far.
Does anyone have the same problem?

Jul 8, 2022, 8:55 PM
Install hardhat using
npm install -g hardhat
Jul 8, 2022, 9:05 PM
Not allowed! https://hardhat.org/hardhat-runner/docs/errors#HH12
Jul 8, 2022, 9:11 PM
you have to prepend it with npx. e.g. npx hardhat.
npx runs the local version of the command
Jul 8, 2022, 10:50 PM
Eyyy bro! Thanks a lot!
I had not thought about that option.

That works for me!
Jul 9, 2022, 4:14 PM

© 2024 Draquery.com All rights reserved.