Skip to content

Instantly share code, notes, and snippets.

@hersonls
Last active December 13, 2015 17:48
Show Gist options
  • Save hersonls/4950594 to your computer and use it in GitHub Desktop.
Save hersonls/4950594 to your computer and use it in GitHub Desktop.
How to install less in DreamHost 1. Install node.js 2. Install npm 3. Install less
#!/bin/sh
git clone git://github.com/ry/node.git
cd node
./configure --prefix=~/.local/usr
make
make install
export npm_config_prefix=~/.local/usr && curl https://npmjs.org/install.sh | sh
npm install less -g
@philipashlock
Copy link

This didn't work for me. In order to get this to work I need to supply the full path rather than use the ~ tilde home directory path for all the prefixes. I also had to update the npmjs URL (https://www.npmjs.com/install.sh)

I also needed to add node to my PATH in .bash_profile. Here's another guide for installing node on dreamhost.

in other words:

#!/bin/sh

git clone git://github.com/ry/node.git
cd node
./configure --prefix=/home/[YOUR-USERNAME]/.local/usr
make
make install

export npm_config_prefix= /home/[YOUR-USERNAME]/.local/usr && curl https://www.npmjs.com/install.sh | sh

npm install less -g

@Koli14
Copy link

Koli14 commented Aug 13, 2015

Two small things, what i needed to change in @philipashlock 's script:
If you clone the git-repo, you will get a -pre version of node, which is not compatible with a lot of thing. So instead of git clone... I did: wget https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz and then tar -zxvf node-v0.12.7.tar.gz.
In the script there there is a whitespace in this line: export npm_config_prefix= /home/...
It's working by me just without the whitespace: export npm_config_prefix=/home/...
Thanks for the script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment