Skip to content

Commit

Permalink
automates the install of npm for versions less than 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
semmypurewal committed Sep 2, 2012
1 parent fe7b52f commit d3bec22
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 41 deletions.
6 changes: 3 additions & 3 deletions README.md
@@ -1,9 +1,9 @@
This is a Vagrant file and set of Chef recipes for building a basic node development environment.
If you're not familiar with Vagrant, read more about it at vagrantup.com.
If you're not familiar with Vagrant, read more about it at http://www.vagrantup.com.

To get this to work, you must have VirtualBox (> 4.1.0) and Vagrant (> 1.0) installed. Installers
for VirtualBox are available at virtualbox.org, and installers for Vagrant are available at
vagrantup.com.
for VirtualBox are available at http://www.virtualbox.org, and installers for Vagrant are available
at http://www.vagrantup.com.

Once you have the pre-requisites installed, simply open a terminal and add the base box:

Expand Down
8 changes: 4 additions & 4 deletions Vagrantfile
Expand Up @@ -10,14 +10,14 @@ Vagrant::Config.run do |config|

config.vm.provision :chef_solo do |chef|
chef.add_recipe "nodejs"
# Uncomment the line below if you're using a version of node
# that doesn't include NPM, (version less than 0.6.3)
# chef.add_recipe "nodejs::npm"
chef.add_recipe "mongodb-debs"
chef.add_recipe "redis-server"
chef.json = {
"nodejs" => {
"version" => "0.8.8",
"version" => "0.8.8"
# uncomment the following line to force
# node to be built from source
# , "from_source" => true
}
}
end
Expand Down
13 changes: 13 additions & 0 deletions cookbooks/nodejs/recipes/default.rb
Expand Up @@ -44,6 +44,19 @@
make install
EOH
end

if node[:nodejs][:version] < "0.6.3"
package "curl"

bash "install npm" do
cwd "/usr/local/src"
user "root"
cwd "/tmp/"
code <<-EOH
curl https://npmjs.org/install.sh | clean=no sh
EOH
end
end
else
bash "install nodejs" do
cwd "/opt"
Expand Down
34 changes: 0 additions & 34 deletions cookbooks/nodejs/recipes/npm.rb

This file was deleted.

0 comments on commit d3bec22

Please sign in to comment.