Yes I know that there are other Linux distributions around but
I am a big fan of debian in general and ubuntu in particular. These
instruction are run against a Amazon EC2 t2.micro instance running
ubuntu 14.04 trusty server.
If you are a Linux user then you must already know a little bit about shells, ssh and
how to use the command line. If not you probably want to use a different platform as your
dance floor.
Let's start a shell and validate the ability to run git from the command prompt:
$ git
The program 'git' is currently not installed. You can install it by typing:
sudo apt-get install git
So I guess it not there. Let's do what it says and install git.
$ sudo apt-get install -y git
sudo: unable to resolve host ip-172-30-0-110
Reading package lists... Done
Building dependency tree
⋮
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,346 kB of archives.
After this operation, 21.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
⋮
Setting up git (1:1.9.1-1ubuntu0.1) ...
$ git --version
git version 1.9.1
$ npm -v
The program 'npm' is currently not installed. You can install it by typing:
sudo apt-get install npm
This error message is a little misleading. The real problem is that I forgot to install Node.js
which includes npm. There are a variety of ways to get Node.js working on Linux.
I like to use a package manager, for ubuntu:
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
## Installing the NodeSource Node.js 4.x LTS Argon repo...
## Populating apt-get cache...
+ apt-get update
⋮
## Confirming "trusty" is supported...
## Adding the NodeSource signing key to your keyring...
## Creating apt sources list file for the NodeSource Node.js 4.x LTS Argon repo...
## Running `apt-get update` for you...
⋮
Fetched 6,624 B in 3s (2,200 B/s)
Reading package lists... Done
## Run `apt-get install nodejs` (as root) to install Node.js 4.x LTS Argon and npm
$ sudo apt-get install -y nodejs
get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Doneq
The following extra packages will be installed:
libicu52 rlwrap
The following NEW packages will be installed:
libicu52 nodejs rlwrap
0 upgraded, 3 newly installed, 0 to remove and 70 not upgraded.
Need to get 13.6 MB of archives.
After this operation, 61.6 MB of additional disk space will be used.
⋮
update-alternatives: using /usr/bin/rlwrap to provide /usr/bin/readline-editor (readline-editor) in auto mode
Setting up nodejs (4.2.2-2nodesource1~trusty1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
So assuming everything went right we should be able to test npm
bower is billed as a package manager for the web. What it saves you from is endless hours
of searching for source components. If you know the name of a component and its author has created a package for it (most
popular components have the by now) then all you need to do to grab a copy using:
bower install
<package>