0

I'm trying to get NodeJS installed on my server.

The instructions suggest doing:

sudo apt-get update
sudo apt-get install nodejs

To which I get:

root@steampunklinode:~# sudo apt-get update
Hit http://nginx.org jessie InRelease
Hit http://nginx.org jessie/nginx Sources
Hit http://nginx.org jessie/nginx amd64 Packages
Ign http://nginx.org jessie/nginx Translation-en_US
Ign http://nginx.org jessie/nginx Translation-en
Reading package lists... Done
root@steampunklinode:~# sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nodejs

I found this post:

How to install latest NodeJS on Debian Jessie?

I tried the suggestion there, but get an error:

root@steampunklinode:~# curl -sL https://deb.nodesource.com/setup | bash -

================================================================================
================================================================================

                           SCRIPT DEPRECATION WARNING

  This script, located at https://deb.nodesource.com/setup, used to
  install Node.js v0.10, is being deprecated and will eventually be made
  inactive.

  You should use the script that corresponds to the version of Node.js you
  wish to install. e.g.

   * https://deb.nodesource.com/setup_4.x â Node.js v4 LTS "Argon" (recommended)
   * https://deb.nodesource.com/setup_6.x â Node.js v6 Current

  Please see https://github.com/nodejs/LTS/ for details about which version
  may be appropriate for you.

  The NodeSource Node.js Linux distributions GitHub repository contains
  information about which versions of Node.js and which Linux distributions
  are supported and how to use the install scripts.
    https://github.com/nodesource/distributions

================================================================================
================================================================================

Continuing in 10 seconds (press Ctrl-C to abort) ...



## Installing the NodeSource Node.js v0.10 repo...


## Populating apt-get cache...

+ apt-get update
Hit http://nginx.org jessie InRelease
Hit http://nginx.org jessie/nginx Sources
Hit http://nginx.org jessie/nginx amd64 Packages
Ign http://nginx.org jessie/nginx Translation-en_US
Ign http://nginx.org jessie/nginx Translation-en
Reading package lists... Done

## Installing packages required for setup: apt-transport-https...

+ apt-get install -y apt-transport-https > /dev/null 2>&1
Error executing command, exiting

Can someone please point me in the right direction? I must be missing something dumb! Thanks

0

1 Answer 1

1

Your repositories are mis-configured. Since you're running Jessie, your /etc/apt/sources.list needs to have

deb http://httpredir.debian.org/debian jessie main
deb-src http://httpredir.debian.org/debian jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

Given your apt-get update output it looks like you've only got Nginx repositories there. If you add the above lines, you'll be able to update again and install Node either using the Debian nodejs package (0.10) or a newer release following the instructions you linked to.

3
  • Thanks. I'm using nginx .. does that matter? Currently I have: deb http://nginx.org/packages/mainline/debian/ jessie nginx deb-src http://nginx.org/packages/mainline/debian/ jessie nginx Dec 14, 2016 at 15:37
  • 1
    Keep those lines, and add the lines in my answer. Dec 14, 2016 at 15:43
  • awesome, thanks :) That did it! (for anyone else reading, I had to do an sudo apt-get update update first, before it would work) Dec 14, 2016 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.