npm get prefix: command not found - node.js

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.

Related

npm - The system cannot find the path specified (But then shows the result)

I am using npm after installing nodejs.
I have installed it once before and I just finished deleting all the components because it kept giving the error in the image below, but when I try to use npm, I keep getting errors saying.
The system cannot find the path specified.
Even though I reinstalled node, it still gives these weird errors where it says the error twice on powershell and once on cmd.
I'm so confused :(
In case you are using nvm to manage your node versions. You can just change your node version and it should work. This solution worked for me.
Check the current nvm version by using the command nvm current.
If that is not the version which you currently installed or updated, use the command nvm use <new_version>
for example: nvm use 16.17.0

-bash: node: command not found [duplicate]

I'm learning laravel and follwing this tutorial,
But when I went try and install npm, is says bash: npm: command not found
If you have already installed nodejs and still getting this error. npm: command not found..
run this
apt-get install -y npm
I also come here for the same problem, The solution I found is to install npm and then restart the Visual Studio Code
in redhat base OS (tested in centos 7)
yum install nodejs npm -y
in debian base OS
apt-get install -y npm
I am following the same tuturial and I had this issue and how I solved is just download the
8.11.4 LTS version
from this link then install it then the command worked just fine!
I know it's an old question. But it keeps showing in google first position and all it says it's "install node.js".
For a newbie this is not obvious, so all you have to do is go to the node.js website and search for the command for your linux distribution version or any other operating system. Here is the link:
https://nodejs.org/en/download/package-manager/
In this page you have to choose your operating system and you'll find your command. Then you just log into your console as a root (using putty for instance) and execute that command.
After that, you log as normal user and go again inside your laravel application folder and run again npm install command, and it should work.
Hope it helps.
The solution is simple.
After installing Node, you should restart your VScode and run npm install command.
If you already installed npm globally on your system, and you are still getting the above error message by using VSCode terminal. Just close your VSCode application and reopen again, that should resolve the issue.
First You need to check the node version using terminal (not gitbash)
node --version
npm --version
if those exists, Restart your pc and check
Cheers !!
In my case it was entirely my fault (as usual) I was changing the system path under the environment variables, in Windows, and messed up the path for Node/NPM. So the solution is to either re-add the path for NPM, see this answer
or the lazy option: re-install it which will re-add it for you.

npm 'command not found' no matter what I try

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.

npm-cli.js not found with the CLI command (in Windows 8.1 OS) npm -v

I am trying to install nodejs and npm in my computer with Windows 8.1 - 64 bit. I downloaded the msi from the official nodejs web site and installed it. When I tried to check the version of node by typing node -v, it worked perfectly. But when I tried to check whether npm is installed properly by typing npm -v, the following error appears.
How to fix this.Can someone help me in this. I referred the answers of similar questions here. And this also.But it did not worked too.
This is could because of incorrect installation. Have you tried reinstallation of Node and NPM? If not, uninstall from Program and Features and follow this walkthrough.
Also, need to set npm as global variable $PATH.

How to properly install node on OSx?

tl;dr: how to install node properly, without all the $PATH errors and command not found?
Let me illustrate my problem with the following story:
I've been trying to install node "properly". I did the basic install, with it's installer, and found this (tl;dr: do not sudo node).
Ok, let's remove node and reinstall it with nvm and all. Great. Now, my $PATH doesn't point properly. Let's search a way to fix the $PATH.
Fixed the $PATH after several tries and failures? Great. Let's test... node -v returns 4.5.0... hmm, I'm sure it had a different version. Anyways, let's try installing gulp.
npm install --global gulp-cli, great, installed. Let's npm gulp -v to see if everything is alright —and it looks alright, as it returns 2.15.9.
So, if I just gulp it should return an error (as I don't have a gulpfile or packages.json). When I gulp at the terminal, it returns: zsh: command not found: gulp
So, i find out there's something not working properly again.
After several tries, removes, uninstalls and reinstalls, I beg your help. How can I remove everything node related from my computer and which is the best way to install node? I just want to use gulp, eslint and sublime text 2 with it.
If I'm doing something terribly wrong or saying incorrect things... call me dumb but please do correct me.
OSx El Capitan 10.11.16
iTerm2 3.0.7 with Oh My Zsh
Sublime Text Stable Channel, Build 3114
I did try with Homebrew and it worked properly.

Resources