The Holy Java

Building the right thing, building it right, fast

Installing Latest Node.JS And NPM Modules With Puppet

Posted by Jakub Holý on June 21, 2013

PuppetLabs’ nodejs module is unfortunately quite out of date, providing Node.js 0.6, however there is a simple way to get the latest Node:

  1. Install the puppetlabs-apt module
  2. Add ppa:chris-lea/node.js to apt
  3. Install nodejs
  4. Steal the npm provider from the puppetlabs-nodejs module
  5. Install a npm module


Stealing the npm package provider:

cd your/puppet/modules/directory
mkdir -p npm-provider/lib/puppet/provider/package
cd npm-provider/lib/puppet/provider/package

Puppet Code:

class prepare {
  class { 'apt': }
  apt::ppa { 'ppa:chris-lea/node.js': }
include prepare

package {'nodejs': ensure => present, require => Class['prepare'],}

package {'grunt-cli':
    ensure   => present,
    provider => 'npm',
    require  => Package['nodejs'],

Sorry, the comment form is closed at this time.

%d bloggers like this: