npm 'command not found' no matter what I try - node.js

On MacOS:
I'm unable to execute any npm package command. Every time I try, I see command not found. Like so:
-bash: live-server: command not found
I've installed node.js directly from the website.
https://nodejs.org/en/download/
I've installed live-server globally, and locally. It appears to work. When I try the command, it fails.
I've removed node.js and npm, re-installed and still fail to execute a command. I'm quite stumped. I've reviewed similar posts, implemented the suggested solutions and still can't manage to execute any npm command.
Several of the posts I've reviewed:
sudo: npm: command not found
NPM Command Not Found After Installing Node
What should I do next?

Are you using Windows?
Did you check if NPM is in Path on "Environments variable"

My bash_profile file had the wrong data saved. Correcting the file solved the problem.

Related

Why do I have to install npm every single time I open up my terminal?

I am following The Odin Project, and I've used this guide to install nvm and node. However, I realized that every time I open the terminal, I have to reinstall everything. When I try to use 'npm', I get the message
-bash: npm: command not found
In order to fix this, I have to do everything in the guide linked above again. Any idea of what I did wrong or is this just the way it is?

-bash: npm: command not found after using Node LTS installation package

I have tried installing Node (and therefore also npm) using the current LTS installer package from their website, which all seemed to go ok. However, when I try using the npm command I get -bash: npm: command not found
As per answers elsewhere on this site I tried the installer again but fared no better. /usr/local/bin is in my $PATH and there is an npm listed in that directory which links to a file called npm-cli.js elsewhere, but when I which npm nothing comes up.
Do I have to add something else to my $PATH?

Why isn't Node.js coming with NPM when installed?

I downloaded Node.js via https://nodejs.org/en/ and installed it successfully. In Terminal, I ran the command node -v which then gives me v11.2.0 indicating that Node.js is indeed installed.
However, upon running npm -v I get an error that says: -bash: npm: command not found. I've looked at everything online, tried everything I possibly could but no luck at all.
It's very frustrating because it said that npm comes with node but it looks like it doesn't.
How can I fix this?
Edit: I'm on Mac

-bash: <npm-package>:command not found [Mac]

I've been installing a lot of packages from Github via NPM. For example, Moneda.
When I try to run the package, I get
-bash: moneda: command not found
This happens for every package I install with NPM from Github.
I've tried resetting bash completely.
This is what I get when typing echo $PATH:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I've tried uninstalling brew, npm, node and reinstalling them all, still not working. I don't know how to fix this.
The bigger question is : where does npm install its packages? If the configuration directory of npm is ~/.npm-global, then you have to update your PATH
export PATH=~/.npm-global/bin:$PATH
More information can be found here

npm get prefix: command not found

Trying to install firebase on the command line, can't do it because I probably need to change npm permissions. Problem is, when I run "npm get prefix" it comes back with "command not found". I know I have node.js, npm, git and bower installed, but I am very new to the command line and can't find anything online that references this. Can anyone help? Using Mac OSX.
I should specify what was going on here: I tried re-installing node.js a few times and it didn't work. I was re-installing the most recent version and for some reason my terminal didn't see it. The problem was fixed when I installed the LTS (Long Term Support) version.

Resources