pnpm: zsh: /opt/homebrew/bin/pnpm: bad interpreter: /opt/homebrew/opt/node/bin/node: no such file or directory
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
9.7.0
Which area(s) of pnpm are affected? (leave empty if unsure)
Operating System (Windows, MacOS, Linux)
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
stop working after an usual
brew update && brew upgrade && brew doctor
Describe the Bug
> pnpm -v
zsh: /opt/homebrew/bin/pnpm: bad interpreter: /opt/homebrew/opt/node/bin/node: no such file or directory
I had to remove pnpm from brew and install it globally using npm.
Expected Behavior
> pnpm -v
9.7.0
Which Node.js version are you using?
v22.5.1
Which operating systems have you used?
- macOS
- Windows
- Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 30
- Comments: 22 (3 by maintainers)
By using
seems work
My solution was to edit
/opt/homebrew/bin/pnpmie/opt/homebrew/bin/pnpm@ -> ../Cellar/pnpm/9.7.0/bin/pnpm, changing the first line to use node from my path instead of assuming I have node installed via Homebrew. I have nvm installed via Homebrew and node installed via nvm. The unedited version of the first line is shown on the second line, commented out.Something clearly broke with pnpm 9.7.0 and nvm-installed node. Everything worked up until yesterday when the new pnpm was updated via homebrew.
certainly the issue seems to involve those who use
nvmI solved it by uninstallingpnpmwith brew and then reinstalling it withCan’t downgrade to 9.6 using homebrew (can only downgrade to pnpm v8.x, as far as I can tell…correct me if I’m wrong). I would simply like to have it working as it always did with brew-installed node. it was working 2 days ago before upgrading to 9.7
The Homebrew team has looked into this, and this should fix the issue when it’s released: https://github.com/Homebrew/brew/pull/17993
These steps worked for me-
pnpm-Either with-
Or with-
curl(Reference link)Now, check the
pnpmversion-@zkochan Looks like it was a change in Homebrew: https://github.com/Homebrew/homebrew-core/issues/176257, https://github.com/Homebrew/brew/pull/17773