Last active
June 1, 2026 13:56
-
-
Save brunos3d/88e8a07f87f3ca9c9876ef8bde7d2768 to your computer and use it in GitHub Desktop.
How to alias your npx npm node globally for MCPs to work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # your .bashrc or .zshrc shit... | |
| npx() { command $HOME/.nvm/versions/node/$(node --version)/bin/npx "$@"; } | |
| npm() { command $HOME/.nvm/versions/node/$(node --version)/bin/npm "$@"; } | |
| node() { command $HOME/.nvm/versions/node/$(node --version)/bin/node "$@"; } | |
| # save and run "source ~/.bashrc" or "source ~/.zshrc" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then you no longer need to use pinned versions of your nvm installation bin path
{ "servers": { "chrome-devtools": { "command": "~/.nvm/versions/node/v22.13.1/bin/npx", "args": ["-y", "chrome-devtools-mcp@latest"] } } }Or dynamic version (it also works, but it's awful)
{ "servers": { "chrome-devtools": { "command": "~/.nvm/versions/node/$(node --version)/bin/npx", "args": ["-y", "chrome-devtools-mcp@latest"] } } }Just use it normally
{ "servers": { "chrome-devtools": { "command": "npx", "args": ["-y", "chrome-devtools-mcp@latest"] } } }