> ## Content Index
> Fetch the complete content index at: https://horrell.ca/llms.txt
> Use this file to discover other available public pages before exploring further.

# Installing node and npm on a Joyent SmartMachine
- URL: https://horrell.ca/2011/01/30/installing-node-and-npm-on-a-joyent-smartmachine/
- Published: 2011-01-30T06:19:12.000Z
- Updated: 2019-05-03T17:56:44.000Z
- Author: Christopher Horrell
- Tags: Joyent, Node.js, #Import 2024-10-01 02:36

Here are some updated instructions for installing the latest stable version of [node](http://nodejs.org/?ref=horrell.ca) (v0.4.12), as well as [npm](http://npmjs.org/?ref=horrell.ca), on a Joyent SmartMachine.

These instructions install node in the `~/local` directory avoiding the need for root privileges when installing things with npm, which is bad.

First, create a `~src/` directory — this is where we’ll download the latest version of node.

```
mkdir ~/src
cd ~/src
curl -O http://nodejs.org/dist/node-v0.4.12.tar.gz

```

Now untar it:

```
gtar -xpf node-v0.4.12.tar.

```

Create the `~/local` directory if it doesn’t already exist:

```
mkdir ~/local

```

Now lets add it to your PATH:

```
echo 'export PATH=$HOME/local/bin:${PATH}' >> ~/.bashrc 
. ~/.bashrc

```

Now, configure, build, and install node:

```
cd node-v*
./configure --with-dtrace --prefix=~/local
gmake install

```

The *gmake* part will probably take the longest. And you’ve probably noticed I’m using *gtar* instead of *tar* and *gmake* instead of make. There are some difference between the Solaris versions and the GNU versions.

Ok, now let’s get things setup for npm:

```
echo tar = gtar >> ~/.npmrc
echo root = $HOME"/.node_libraries" >> ~/.npmrc
echo binroot = $HOME"/local/bin" >> ~/.npmrc
echo manroot = $HOME"/local/share/man" >> ~/.npmrc

```

Ok, now lets install npm:

```
curl http://npmjs.org/install.sh | sh

```

And that’s it!