vscode-shellcheck: shellcheck not found on M1 Mac

I’m getting this error when I open a shell script:

The shellcheck program was not found (not installed?). Use the ‘shellcheck.executablePath’ setting to configure the location of ‘shellcheck’

I have shellcheck installed via Homebrew:

% which shellcheck
/opt/homebrew/bin/shellcheck

Poking around a bit, I found what looks like the relevant source:

https://github.com/timonwong/vscode-shellcheck/blob/3a803d31912b863985405da042339db98fda0c56/src/linter.ts#L136

https://github.com/timonwong/vscode-shellcheck/blob/3a803d31912b863985405da042339db98fda0c56/src/linter.ts#L199

From that, I can see that there isn’t a binary for the M1 architecture:

% tree ~/.vscode/extensions/timonwong.shellcheck-0.14.1/binaries
/Users/bhrutledge/.vscode/extensions/timonwong.shellcheck-0.14.1/binaries
├── darwin
│   └── x64
│       └── shellcheck
├── linux
│   ├── arm
│   │   └── shellcheck
│   ├── arm64
│   │   └── shellcheck
│   └── x64
│       └── shellcheck
└── win32
    └── x32
        └── shellcheck.exe

Still, I would have expected the default of shellcheck to work. I thought it might be related to my runtime PATH not being set properly, but looking at process.env.PATH from the VS Code Developer Tools shows that it includes /opt/homebrew/bin.

Of course, this is a minor annoyance, because I can set it manually, but it’d be nice if it just worked. 😄

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Will let you know ASAP, hopefully in the next week. Need to get download approved by security for that specific file.

Did you try "shellcheck.executablePath": "shellcheck"?