protofire / solhint

Solhint is an open-source project to provide a linting utility for Solidity code.
https://protofire.github.io/solhint/
MIT License
1.04k stars 162 forks source link

Solhint npm installed executable won't run - throws error "Unexpected Token" #547

Closed CadeMichael closed 9 months ago

CadeMichael commented 9 months ago

I was able to successfully install solhint but am getting the following error when trying to run the executable

/home/cade/.npm-global/lib/node_modules/solhint/node_modules/cosmiconfig/dist/index.js:78 if (metaConfig.config?.loaders) { ^

SyntaxError: Unexpected token '.'

I'm not sure if this is something with solhint or my computer, I'm currently using linux mint and have node / npm installed.

CadeMichael commented 9 months ago

It's an issue with older node provided by mint. The optional operator isn't supported on the linux mint node version.