Was following this article ran the command
npm install --dev hardhat @nomicfoundation/hardhat-toolbox
got the successful response. However when I try to run the
npx hardhat
getting Unexpected token ?
response.
Tried removing the package-local.json. Also tried removing the global installation. Nothing worked.
3
Answers
I also got the same error!
After i upgrade my nodejs version to v16.17.0 and npm version to 8.15.0, error is gone
Once the reported error is gone then you should see the below message
I have had a similar issue attempting to install hardhat via
npx hardhat
.I found the solution from user I Like resolved this. Make sure you are using correct version of node. try
nvm use 18
and had success!
I also got the same error when I was installing the hardhat:
try this command on your terminal
basically above commands will increase your node.js and npm version
then try to install