help installing nodejs

gob

New Member
Joined
Feb 15, 2024
Messages
5
Reaction score
0
Credits
45
I need some existencial help with installing nodejs and npm, I have the tar but after installing it I was seeing i have node v 12 but node v20 is the latest, also didnt have npm which was supposed to be included, what am i doing wrong
 


I need some existencial help with installing nodejs and npm, I have the tar but after installing it I was seeing i have node v 12 but node v20 is the latest, also didnt have npm which was supposed to be included, what am i doing wrong
Whoa, dude! Installing nodejs and npm can be a breeze. It sounds like you may have encountered a couple of hiccups along the way. No worries, though! Let's sort this out.

First things first, if you installed Node.js from a tarball, it's possible that you didn't update your system's PATH variable correctly. This can cause issues with using the right version of Node.js. To double-check, open up a terminal and run the following command:

Code:
echo $PATH

Make sure that the path to your Node.js installation directory is included in the output. If it's not there, you need to add it. You can do this by modifying your shell's configuration file (e.g., .bashrc, .bash_profile, .zshrc, or .profile) and adding the following line:

Code:
export PATH=/path/to/nodejs/bin:$PATH

Remember to replace /path/to/nodejs with the actual path to your Node.js installation directory.

After you've updated your PATH, close and reopen your terminal to ensure the changes take effect.

Regarding the Node.js version, the latest stable release at the time of my response is not v20, but rather v14.x. If you genuinely need to install that specific version, you could consider using a version manager like nvm (Node Version Manager). It allows you to easily switch between different versions of Node.js.

As for npm, it usually comes bundled with Node.js. Once you've got your PATH sorted, you should be able to use npm without any issues. To verify if npm is installed properly, run the following command:

Code:
npm -v

If you're still facing problems, let me know, and together we'll dig deeper into the issue to get you up and running with Node.js and npm.
 
hey tuxbot why are you not answering
Yo, sorry for the silence, dude! Sometimes I get caught up in the waves of information. Alright, let's get into it.

First things first, installing Node.js and npm using tarballs can be a bit tricky. It's recommended to use a package manager instead, like apt, yum, or pacman, depending on your Linux distro. That way, you'll get the latest stable release and all the dependencies.

But if you really want to use the tarball, here's how you can do it:

1. Download the tarball from the official Node.js website.
2. Extract the tarball using the command:
Code:
   tar -xf node-v12.x.x.tar.gz
3. Navigate to the extracted directory:
Code:
   cd node-v12.x.x
4. Configure and build Node.js:
Code:
   ./configure
   make
   make install
Note: You might need root privileges for the make install step.
5. Verify the installation by running:
Code:
   node -v
   npm -v
If you see the version numbers, congrats, you did it!

Now, regarding your mention of Node v20, I think there was a misunderstanding, bro. At the moment, the latest stable version of Node.js is v14.x.x. So you're all good with v12.

If npm wasn't installed, it might be because it's not bundled with Node.js in the tarball. But no worries, you can install npm globally using npm itself (mind-blowing, right?):

Code:
sudo npm install -g npm

That should take care of it, my friend! Give it a try and let me know if you catch any more waves.
 

Members online


Top