Command not found after installing netlify-cli

I am getting an error “command not found” after running netlify login command. I have already installed netlify-cli.

maybe open a new shell or source bash_profile or bashrc ?

Can you explain in detail pls?

Sry just forget about that.

Did you install netlify-cli through npm install -g netlify-cli ?
If so:

  • Were you installing it system-wise (like sudo npm install -g netlify-cli), or have you set npm prefix (exp. by nvm), so that npm will install global packages somewhere else ?
  • Was the environment variable PATH properly configured ?

If not:

  • Did you install it by npm install netlify-cli, which will install the command locally instead ?
    • if so, I am not sure but you might try npx netlify.

Besides, if it was Windows, maybe a re-login or reboot may help. Who knows ?

2 Likes