Skip to content

Instantly share code, notes, and snippets.

@tanelih
Created November 28, 2014 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanelih/2e8cfcaeacf1a443edc3 to your computer and use it in GitHub Desktop.
Save tanelih/2e8cfcaeacf1a443edc3 to your computer and use it in GitHub Desktop.
Simple Node.JS provisioning script for Vagrant
#!/bin/bash
# Vagrant provisioning script for setting up a simple 'nodejs' development
# environment.
#
# > vagrant up && vagrant ssh
# > cd <my-synced-folder> && npm install
#
# If you are also doing 'front-end' development, you might want to add:
# gem install sass
# npm install -g bower
#
# Tested on:
# ubuntu/trusty32
# ubuntu/trusty64
#
# See also:
# https://docs.vagrantup.com
# https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
curl -sL https://deb.nodesource.com/setup | sudo bash -
apt-get update
apt-get install -y git nodejs build-essential
npm install -g gulp
@leandrocrs
Copy link

https://deb.nodesource.com/setup executes apt-get update automatically after add node repository. One question: did you tested the performance with virtualbox shared folder? In my tests, it's very slow.

@wildmolasses
Copy link

Nice! https://deb.nodesource.com/setup has now been deprecated; they suggest using https://deb.nodesource.com/setup_4.x instead.

@wildmolasses
Copy link

@leandrw I have the same issue; I'd suggest an npm install to virtual directory first, then move to shared.

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