View Snippet #212

    
$ sudo apt-get purge nodejs npm
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get install -y nodejs

## 
## not recommended on live servers, but seems to be the only way
## to get it to work; this command sets npm to use http rather than https
##

$ sudo npm config set registry http://registry.npmjs.org/

## now install inliner - NOTE use of SUDO
$ sudo npm install inliner -g

##
## now apply a patch to inliner as follows
##
$ cd /usr/lib/node_modules/inline
$ sudo vi inliner
/scriptURL

## now change the first line to look like the second
- scriptURL = URL.resolve(url, this.src);


+ scriptURL = URL.resolve(url, (this.src||"").toString());

## to do this, arrow across to this.src and use 'x' key to delete this.src then hit 'i' to go into insert mode
## paste in (this.src||"").toString() and then hit ESC followed by ":x!" and hit return
## now cd into the bin directory and edit inliner

$cd bin

$ sudo vi inliner

/path.ex

## change "path" to "fs" and save using ":x!"

## now go back to your home directory

$ cd