Jump to content

Trying to install Node.js on old Ubuntu... Could someone tell me what the sources list for it is?

Go to solution Solved by Sauron,

Ubuntu 16.04 is still fully supported (it's an LTS release) so you don't need to update your sources.list file.

 

You can install node.js by following the instructions on the github page.

 

-edit-

you can also use snap which is a bit less clunky than curling an installation script

Hey! I'm trying to make an interactive bot that talks via Twitter through Node.js V.8.0.0. It's 2019 and I don't think the servers for 16.04. (It was the only download I could find for a strictly 32-bit system (Yes... It's an old server. I don't need a new one I don't think.)

 

Could someone please tell me what the old source list for it?

 

I use Ubuntu 16.04 Server edition, w/o any updates. It doesn't have a graphical interface installed since it's a server, and I don't need any security updates since the server won't hold anything important (This is more of a project than anything.)

Link to comment
Share on other sites

Link to post
Share on other sites

Ubuntu 16.04 is still fully supported (it's an LTS release) so you don't need to update your sources.list file.

 

You can install node.js by following the instructions on the github page.

 

-edit-

you can also use snap which is a bit less clunky than curling an installation script

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Sauron said:

Ubuntu 16.04 is still fully supported (it's an LTS release) so you don't need to update your sources.list file.

 

You can install node.js by following the instructions on the GitHub page.

 

-edit-

you can also use snap which is a bit less clunky than curling an installation script

 

Thanks so much for the quick response! I forgot that my home network is trash lel.

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Underfire17 said:

Thanks so much for the quick response! I forgot that my home network is trash lel.

No worries!

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, Sauron said:

Ubuntu 16.04 is still fully supported (it's an LTS release) so you don't need to update your sources.list file.

 

You can install node.js by following the instructions on the github page.

 

-edit-

you can also use snap which is a bit less clunky than curling an installation script

Please dont do this and use this

 

https://github.com/creationix/nvm

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

I am gonna walk you step by step since all the above solutions need you to do a bit of reading and troubleshooting. 

 

first install node.js by using this command in a terminal

Spoiler

sudo apt install node

then you can write your js code to a .js file and run it like a script.  node can be quite a nice python or perl script replacement actually. 

e.g. assuming i wrote a node.js code to a file call hello_world.js

Spoiler

#!/usr/bin/node

console.log("Hello World!");

 

then make it executable 

Spoiler

chmod +x hello_world.js

then run it

Spoiler

./hello_world.js

 

thats all you need. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, wasab said:

I am gonna walk you step by step since all the above solutions need you to do a bit of reading and troubleshooting. 

 

first install node.js by using this command in a terminal

  Reveal hidden contents

sudo apt install node

then you can write your js code to a .js file and run it like a script

e.g. assuming i wrote a node.js code to a file call hello_world.js

  Reveal hidden contents


#!/usr/bin/node

console.log("Hello World!");

 

then make it executable 

  Hide contents

chmod +x hello_world.js

then run it

  Reveal hidden contents

./hello_world.js

 

thats all you need. 

Like I said you sint want to install from apt as you're reliant on sources to maintain the package.

 

Using nvm installs using binaries downloaded from the website and also install under your account not root.

 

Nvm also allows for multiple versions of node to be installed and to quickly jump between them.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, vorticalbox said:

Like I said you sint want to install from apt as you're reliant on sources to maintain the package.

 

Using nvm installs using binaries downloaded from the website and also install under your account not root.

 

Nvm also allows for multiple versions of node to be installed and to quickly jump between them.

do you really need multiple version of node on your system? if so, what for? 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

28 minutes ago, vorticalbox said:

Please dont do this and use this

 

https://github.com/creationix/nvm

May I ask what's wrong with the official instructions?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Sauron said:

May I ask what's wrong with the official instructions?

Nothing inherently wrong, but after working with node exclusively for the last year and a half using nvm has made life easier.

 

For example AWS lambda only uses node 8.10 however our docker images run lts node. So jumping between then is as simple is

 

nvm use 8.10

 

It also keeps all the binaries and global npm package sperated out so if you switch versions you have a clean environment to play with.

 

It's not much different than uses venv when developing in python.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, vorticalbox said:

Please dont do this and use this

 

https://github.com/creationix/nvm

1

I ended up trashing the original idea since that version of Ubuntu Server couldn't find the installation media that was on my USB. (as well as not installing it correctly when it did.) I found an I386 version on my Ubuntu laptop that can be installed via USB and is still up to date (as of 18.04). I will update asap though. Thanks for the NVM suggestion by the way my project needs that as well.

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, wasab said:

I am gonna walk you step by step since all the above solutions need you to do a bit of reading and troubleshooting. 

 

first install node.js by using this command in a terminal

  Reveal hidden contents

sudo apt install node

then you can write your js code to a .js file and run it like a script.  node can be quite a nice python or perl script replacement actually. 

e.g. assuming i wrote a node.js code to a file call hello_world.js

  Reveal hidden contents


#!/usr/bin/node

console.log("Hello World!");

 

then make it executable 

  Reveal hidden contents

chmod +x hello_world.js

then run it

  Reveal hidden contents

./hello_world.js

 

thats all you need. 

Thanks for the reply! I had to switch to a newer version (I had a current i386 image on my Ubuntu PC for some reason) but it does mean a lot that you replied and gave me instructions on how to fix this! Thanks again!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×