EACCES on npm install -g: use nvm or set an npm
user prefix (above). Never sudo npm — it writes into dpkg-managed paths that npm
cannot cleanly track or remove on the next upgrade.
calm: command not found: run npm config get prefix and confirm
that <prefix>/bin is on PATH. With a user prefix, add
export PATH="$HOME/.npm-global/bin:$PATH" to ~/.bashrc.
Node version mismatch: the CLI’s documented floor is Node 20+. If the apt-installed Node is older,
uninstall it and use NodeSource as above, or switch to
nvm install 22 && nvm use 22.
Behind a corporate proxy: set HTTPS_PROXY, HTTP_PROXY, and
NO_PROXY in the shell before npm install. For npm itself, also configure
npm config set proxy and npm config set https-proxy.