question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shellcheck not found on M1 Mac

See original GitHub issue

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. 😄

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
felipecrscommented, Jun 12, 2021

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

0reactions
felipecrscommented, Dec 16, 2022

@lu-yanda what’s this hook, man? Seems like the extension is trying to use this hook (check your vscode settings), and the hook can’t find shellcheck installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

shellcheck not found on M1 Mac · Issue #244 - GitHub
I'm getting this error when I open a shell script: The shellcheck program was not found (not installed?). Use the 'shellcheck.
Read more >
shellcheck - Homebrew Formulae
Static analysis and lint tool, for (ba)sh scripts. https://www.shellcheck.net/. License: GPL-3.0-or-later. Formula JSON API: /api/formula/shellcheck.json.
Read more >
Unfortunately, last I checked, shellcheck is not compatible with ...
on: ShellCheck: Finds bugs in your shell scripts. Unfortunately, last I checked, shellcheck is not compatible with M1 macs yet.
Read more >
bash - Detect Apple Silicon from command line - Stack Overflow
I found that sysctl -n machdep.cpu.brand_string reported Apple M1 ... with your user account. sysctl: command not found > sudo sysctl -n ...
Read more >
Install shellcheck on macOS with MacPorts
ShellCheck, a static analysis tool for shell scripts ... To install shellcheck, paste this in macOS terminal after installing MacPorts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found