Skip to content

Instantly share code, notes, and snippets.

@roachhd
Forked from isaacs/node-and-npm-in-30-seconds.sh
Last active August 29, 2015 14:12

Revisions

  1. @isaacs isaacs revised this gist Mar 11, 2014. 7 changed files with 7 additions and 7 deletions.
    2 changes: 1 addition & 1 deletion node-and-npm-in-30-seconds.sh
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,4 @@ cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/local
    make install # ok, fine, this step probably takes more than 30 seconds...
    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,4 @@ cd node-install/*
    make install

    # now the npm easy-install
    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion use-nave-no-shell.sh
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,4 @@ sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
    # install the latest stable nodejs in the "main" root.
    nave usemain stable

    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ sudo ln -s $PWD/nave.sh /usr/local/bin/nave
    nave use 0.4.8

    # to install npm in that virtualenv
    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh

    # do stuff...
    npm install whatever etc
    2 changes: 1 addition & 1 deletion using-homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,4 @@ brew install node

    # now install npm
    # prefix will default to $(brew --prefix)
    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion xgd-freedesktop.org-style.sh
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/.local
    make install
    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion yet-another-option.sh
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@
    # we're telling npm to install in a different place.

    echo prefix = ~/local >> ~/.npmrc
    curl https://npmjs.org/install.sh | sh
    curl https://www.npmjs.org/install.sh | sh
  2. @isaacs isaacs revised this gist Aug 28, 2012. 7 changed files with 7 additions and 7 deletions.
    2 changes: 1 addition & 1 deletion node-and-npm-in-30-seconds.sh
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,4 @@ cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/local
    make install # ok, fine, this step probably takes more than 30 seconds...
    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,4 @@ cd node-install/*
    make install

    # now the npm easy-install
    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion use-nave-no-shell.sh
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,4 @@ sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
    # install the latest stable nodejs in the "main" root.
    nave usemain stable

    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ sudo ln -s $PWD/nave.sh /usr/local/bin/nave
    nave use 0.4.8

    # to install npm in that virtualenv
    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh

    # do stuff...
    npm install whatever etc
    2 changes: 1 addition & 1 deletion using-homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,4 @@ brew install node

    # now install npm
    # prefix will default to $(brew --prefix)
    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion xgd-freedesktop.org-style.sh
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,4 @@ cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/.local
    make install
    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh
    2 changes: 1 addition & 1 deletion yet-another-option.sh
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@
    # we're telling npm to install in a different place.

    echo prefix = ~/local >> ~/.npmrc
    curl http://npmjs.org/install.sh | sh
    curl https://npmjs.org/install.sh | sh
  3. @isaacs isaacs revised this gist May 26, 2011. 4 changed files with 6 additions and 30 deletions.
    4 changes: 2 additions & 2 deletions use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ sudo ln -s $PWD/nave.sh /usr/local/bin/nave
    # you never have to go back in there.

    # to use a version of node in a virtual environment
    nave use 0.2.3
    nave use 0.4.8

    # to install npm in that virtualenv
    curl http://npmjs.org/install.sh | sh
    @@ -25,5 +25,5 @@ npm install whatever etc
    exit

    # use a different version of node..
    nave use 0.2.1
    nave use 0.4.6
    # etc...
    11 changes: 2 additions & 9 deletions using-homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -14,13 +14,6 @@ sudo chown -R $USER $PREFIX/{share/man,bin,lib/node,include/node}

    brew install node

    # add prefix/lib/node to your NODE_PATH, because it won't
    # be picked up by default in a brew install of node.
    if ! [ "x$NODE_PATH" = "x" ]; then
    NODE_PATH="${NODE_PATH}:"
    fi
    echo 'export NODE_PATH=$NODE_PATH'$PREFIX'/lib/node' >> ~/.bashrc
    . ~/.bashrc

    # now install npm
    curl http://npmjs.org/install.sh | sh
    # prefix will default to $(brew --prefix)
    curl http://npmjs.org/install.sh | sh
    16 changes: 0 additions & 16 deletions using-isaacs-homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +0,0 @@
    # using Homebrew

    PREFIX=$(brew --prefix)

    # do this to get just the npm recipe from my homebrew fork.
    cd $PREFIX
    git remote add isaacs git://github.com/isaacs/homebrew.git
    git fetch -a isaacs
    git checkout isaacs/master -- Library/Formula/npm.rb

    # alternatively, you could also do this if you prefer to avoid git:
    # curl https://github.com/isaacs/homebrew/raw/master/Library/Formula/npm.rb > $PREFIX/Library/Formula/npm.rb

    brew install npm

    # now do ALL the things that it says to do, or it won't work properly!
    5 changes: 2 additions & 3 deletions yet-another-option.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    # install node wherever.
    # use sudo even, it doesn't matter
    # we're telling npm to install in a different place.
    cat <<NPMRC >>$HOME/.npmrc
    prefix = ~/local
    NPMRC

    echo prefix = ~/local >> ~/.npmrc
    curl http://npmjs.org/install.sh | sh
  4. @isaacs isaacs revised this gist May 26, 2011. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions yet-another-option.sh
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,6 @@
    # use sudo even, it doesn't matter
    # we're telling npm to install in a different place.
    cat <<NPMRC >>$HOME/.npmrc
    root = ~/.node_libraries
    manroot = ~/local/share/man
    binroot = ~/bin
    prefix = ~/local
    NPMRC
    curl http://npmjs.org/install.sh | sh
  5. @isaacs isaacs revised this gist May 26, 2011. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions only-git-all-the-way.sh
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@

    mkdir ~/local
    echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
    . ~/.bashrc

    # could also fork, and then clone your own fork instead of the official one

  6. @isaacs isaacs revised this gist Mar 22, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}
    # now just a pretty vanilla node install
    # let it use the default paths, but don't use sudo, since there's no need
    mkdir node-install
    curl http://nodejs.org/dist/node-v0.2.5.tar.gz | tar -xzf - -C node-install
    curl http://nodejs.org/dist/node-v0.4.3.tar.gz | tar -xzf - -C node-install
    cd node-install/*
    ./configure
    make install
  7. @isaacs isaacs revised this gist Mar 11, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions only-git-all-the-way.sh
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,9 @@
    mkdir ~/local
    echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

    # could also fork, and then clone your own fork instead of ry's
    # could also fork, and then clone your own fork instead of the official one

    git clone git://github.com/ry/node.git
    git clone git://github.com/joyent/node.git
    cd node
    ./configure --prefix=~/local
    make install
  8. @isaacs isaacs revised this gist Dec 31, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion using-isaacs-homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ git fetch -a isaacs
    git checkout isaacs/master -- Library/Formula/npm.rb

    # alternatively, you could also do this if you prefer to avoid git:
    # curl http://github.com/isaacs/homebrew/raw/Library/Formula/npm.rb > $PREFIX/Library/Formula/npm.rb
    # curl https://github.com/isaacs/homebrew/raw/master/Library/Formula/npm.rb > $PREFIX/Library/Formula/npm.rb

    brew install npm

  9. @isaacs isaacs revised this gist Dec 31, 2010. 1 changed file with 16 additions and 0 deletions.
    16 changes: 16 additions & 0 deletions using-isaacs-homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # using Homebrew

    PREFIX=$(brew --prefix)

    # do this to get just the npm recipe from my homebrew fork.
    cd $PREFIX
    git remote add isaacs git://github.com/isaacs/homebrew.git
    git fetch -a isaacs
    git checkout isaacs/master -- Library/Formula/npm.rb

    # alternatively, you could also do this if you prefer to avoid git:
    # curl http://github.com/isaacs/homebrew/raw/Library/Formula/npm.rb > $PREFIX/Library/Formula/npm.rb

    brew install npm

    # now do ALL the things that it says to do, or it won't work properly!
  10. @isaacs isaacs renamed this gist Dec 30, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  11. @isaacs isaacs revised this gist Dec 30, 2010. 1 changed file with 26 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions homebrew.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # using Homebrew

    # Note: `brew install npm` has problems, as of 2010-12-30.
    # hopefully it will eventually be good and happy.
    # As of npm@0.2.13, however, this is an option

    PREFIX=$(brew --prefix)

    # take ownership
    # this will also let homebrew work without using sudo
    # please don't do this if you don't know what it does!
    sudo mkdir -p $PREFIX/{share/man,bin,lib/node,include/node}
    sudo chown -R $USER $PREFIX/{share/man,bin,lib/node,include/node}

    brew install node

    # add prefix/lib/node to your NODE_PATH, because it won't
    # be picked up by default in a brew install of node.
    if ! [ "x$NODE_PATH" = "x" ]; then
    NODE_PATH="${NODE_PATH}:"
    fi
    echo 'export NODE_PATH=$NODE_PATH'$PREFIX'/lib/node' >> ~/.bashrc
    . ~/.bashrc

    # now install npm
    curl http://npmjs.org/install.sh | sh
  12. @isaacs isaacs revised this gist Dec 27, 2010. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion use-nave-no-shell.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,8 @@ sudo ln -s $PWD/nave.sh /usr/local/bin/nave

    # take ownership
    # please don't do this if you don't know what it does!
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node}
    sudo mkdir -p /usr/local/{share/man,bin,lib/node,include/node}
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}

    # install the latest stable nodejs in the "main" root.
    nave usemain stable
  13. @isaacs isaacs revised this gist Dec 27, 2010. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # take ownership of the folders that npm/node use
    # please don't do this if you don't know what it does!
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node}
    sudo mkdir -p /usr/local/{share/man,bin,lib/node,include/node}
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node,include/node}

    # now just a pretty vanilla node install
    # let it use the default paths, but don't use sudo, since there's no need
  14. @isaacs isaacs revised this gist Dec 11, 2010. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion yet-another-option.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # install node wherever...
    # install node wherever.
    # use sudo even, it doesn't matter
    # we're telling npm to install in a different place.
    cat <<NPMRC >>$HOME/.npmrc
    root = ~/.node_libraries
    manroot = ~/local/share/man
  15. @isaacs isaacs revised this gist Dec 11, 2010. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion use-nave-no-shell.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    # note that we're doing "usemain" instead of "use"

    mkdir ~/.nave
    cd ~/nave
    cd ~/.nave
    wget http://github.com/isaacs/nave/raw/master/nave.sh
    sudo ln -s $PWD/nave.sh /usr/local/bin/nave

    2 changes: 1 addition & 1 deletion use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    # make a folder where you want to keep this stuff.

    mkdir ~/.nave
    cd ~/nave
    cd ~/.nave
    wget http://github.com/isaacs/nave/raw/master/nave.sh
    sudo ln -s $PWD/nave.sh /usr/local/bin/nave

  16. @isaacs isaacs revised this gist Dec 11, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion node-and-npm-in-30-seconds.sh
    Original file line number Diff line number Diff line change
    @@ -5,5 +5,5 @@ mkdir ~/node-latest-install
    cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/local
    make install
    make install # ok, fine, this step probably takes more than 30 seconds...
    curl http://npmjs.org/install.sh | sh
  17. @isaacs isaacs revised this gist Dec 10, 2010. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion only-git-all-the-way.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    # this way is best if you want to stay up to date
    # or submit patches to node or npm

    mkdir ~/local
    echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

    @@ -11,4 +14,4 @@ cd ..

    git clone git://github.com/isaacs/npm.git
    cd npm
    make install
    make install # or `make link` for bleeding edge
  18. @isaacs isaacs revised this gist Dec 10, 2010. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions only-git-all-the-way.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    mkdir ~/local
    echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

    # could also fork, and then clone your own fork instead of ry's

    git clone git://github.com/ry/node.git
    cd node
    ./configure --prefix=~/local
    make install
    cd ..

    git clone git://github.com/isaacs/npm.git
    cd npm
    make install
  19. @isaacs isaacs revised this gist Dec 10, 2010. 3 changed files with 23 additions and 2 deletions.
    5 changes: 5 additions & 0 deletions take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    # take ownership of the folders that npm/node use
    # please don't do this if you don't know what it does!
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node}

    # now just a pretty vanilla node install
    # let it use the default paths, but don't use sudo, since there's no need
    mkdir node-install
    curl http://nodejs.org/dist/node-v0.2.5.tar.gz | tar -xzf - -C node-install
    cd node-install/*
    ./configure
    make install

    # now the npm easy-install
    curl http://npmjs.org/install.sh | sh
    16 changes: 16 additions & 0 deletions use-nave-no-shell.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # use nave, but without a subshell
    # note that we're doing "usemain" instead of "use"

    mkdir ~/.nave
    cd ~/nave
    wget http://github.com/isaacs/nave/raw/master/nave.sh
    sudo ln -s $PWD/nave.sh /usr/local/bin/nave

    # take ownership
    # please don't do this if you don't know what it does!
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node}

    # install the latest stable nodejs in the "main" root.
    nave usemain stable

    curl http://npmjs.org/install.sh | sh
    4 changes: 2 additions & 2 deletions use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@

    # make a folder where you want to keep this stuff.

    mkdir my-happy-node-stuff
    cd my-happy-node-stuff
    mkdir ~/.nave
    cd ~/nave
    wget http://github.com/isaacs/nave/raw/master/nave.sh
    sudo ln -s $PWD/nave.sh /usr/local/bin/nave

  20. @isaacs isaacs revised this gist Dec 10, 2010. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # take ownership of the folders that npm/node use
    # please don't do this if you don't know what it does!
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node}
    mkdir node-install
    curl http://nodejs.org/dist/node-v0.2.5.tar.gz | tar -xzf - -C node-install
  21. @isaacs isaacs revised this gist Dec 10, 2010. 2 changed files with 8 additions and 1 deletion.
    8 changes: 8 additions & 0 deletions take-ownership.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # take ownership of the folders that npm/node use
    sudo chown -R $USER /usr/local/{share/man,bin,lib/node}
    mkdir node-install
    curl http://nodejs.org/dist/node-v0.2.5.tar.gz | tar -xzf - -C node-install
    cd node-install/*
    ./configure
    make install
    curl http://npmjs.org/install.sh | sh
    1 change: 0 additions & 1 deletion use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    # this way is really handy if you want to test things
    # in different versions of node and use stable release
    # versions of things.
  22. @isaacs isaacs revised this gist Oct 24, 2010. 1 changed file with 30 additions and 0 deletions.
    30 changes: 30 additions & 0 deletions use-nave.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@

    # this way is really handy if you want to test things
    # in different versions of node and use stable release
    # versions of things.

    # make a folder where you want to keep this stuff.

    mkdir my-happy-node-stuff
    cd my-happy-node-stuff
    wget http://github.com/isaacs/nave/raw/master/nave.sh
    sudo ln -s $PWD/nave.sh /usr/local/bin/nave

    # now you can forget about that folder.
    # you never have to go back in there.

    # to use a version of node in a virtual environment
    nave use 0.2.3

    # to install npm in that virtualenv
    curl http://npmjs.org/install.sh | sh

    # do stuff...
    npm install whatever etc

    # return to non-nave-land
    exit

    # use a different version of node..
    nave use 0.2.1
    # etc...
  23. @isaacs isaacs revised this gist Oct 5, 2010. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions yet-another-option.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # install node wherever...
    cat <<NPMRC >>$HOME/.npmrc
    root = ~/.node_libraries
    manroot = ~/local/share/man
    binroot = ~/bin
    NPMRC
    curl http://npmjs.org/install.sh | sh
  24. @isaacs isaacs renamed this gist Oct 1, 2010. 1 changed file with 0 additions and 0 deletions.
  25. @isaacs isaacs revised this gist Oct 1, 2010. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions xgd-freedesktop.org-style.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
    echo 'export npm_config_userconfig=$HOME/.config/npmrc' >> ~/.bashrc
    . ~/.bashrc
    mkdir ~/.local
    mkdir ~/node-latest-install
    cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/.local
    make install
    curl http://npmjs.org/install.sh | sh
  26. @isaacs isaacs created this gist Sep 14, 2010.
    9 changes: 9 additions & 0 deletions zero-to-node-in-30-seconds.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
    . ~/.bashrc
    mkdir ~/local
    mkdir ~/node-latest-install
    cd ~/node-latest-install
    curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
    ./configure --prefix=~/local
    make install
    curl http://npmjs.org/install.sh | sh