npx hardhat compile Unexpected token?

Viewed 243

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.

1 Answers

I also got the same error!

  ~ npx hardhat Unexpected token '?'

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

āžœ  ~ npx hardhat
888    888                      888 888               888
888    888                      888 888               888
888    888                      888 888               888
8888888888  8888b.  888d888 .d88888 88888b.   8888b.  888888
888    888     "88b 888P"  d88" 888 888 "88b     "88b 888
888    888 .d888888 888    888  888 888  888 .d888888 888
888    888 888  888 888    Y88b 888 888  888 888  888 Y88b.
888    888 "Y888888 888     "Y88888 888  888 "Y888888  "Y888

 Welcome to Hardhat v2.11.2 ā€
Related