Forge Home

nodejs

This module allows to install Node.js and NPM.

1,467,654 downloads

20,897 latest version

3.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.1.2 (latest)
  • 2.1.1
  • 2.1.0
  • 2.0.3
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 2.0.0-alpha3
  • 2.0.0-alpha2
  • 2.0.0-alpha1
  • 1.9.6
  • 1.9.5
  • 1.9.4
  • 1.9.3
  • 1.9.2
  • 1.9.1
  • 1.9.0
  • 1.8.6
  • 1.8.5
  • 1.8.4
  • 1.8.3
  • 1.8.2
  • 1.8.1
  • 1.8.0
  • 1.7.1
  • 1.7.0
  • 1.6.5
  • 1.6.4
  • 1.6.3
  • 1.6.2
  • 1.6.1
  • 1.6.0
  • 1.5.1
  • 1.5.0
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.0
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Sep 7th 2013

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'willdurand-nodejs', '1.1.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add willdurand-nodejs
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install willdurand-nodejs --version 1.1.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: nodejs, node, npm

Documentation

willdurand/nodejs — version 1.1.2 Sep 7th 2013

puppet-nodejs

Build
Status

This module allows to install Node.js and NPM. This module is published on the Puppet Forge as willdurand/nodejs.

Installation

Get the module by cloning the repository:

git clone git://github.com/willdurand/puppet-nodejs.git modules/nodejs

Or use the Puppet Module Tool:

puppet module install willdurand/nodejs

Requirements

This modules depends on puppetlabs/stdlib. You MUST clone it if you don't use the Puppet Module Tool:

git clone git://github.com/puppetlabs/puppetlabs-stdlib.git modules/stdlib

Usage

Include the nodejs class:

include nodejs

You can specify a Node.js version by specifing it:

class { 'nodejs':
  version => 'v0.10.17',
}

You can install different versions of Node.js thanks to the nodejs::install definition:

nodejs::install { 'v0.10.17':
  version => 'v0.10.17',
}

Shortcuts are provided to easily install the 'latest' or 'stable' release by setting the version parameter to latest or stable. It will automatically look for the last release available.

class { 'nodejs':
  version => 'stable',
}

By default, this module creates symlinks for each Node.js version installed into /usr/local/bin. You can change this behavior by using the target_dir parameter.

Also, this module installs NPM by default. You can set the with_npm parameter to false to not install it.

This module will make install Node.js by default, to use prebuilt versions distributed by Node.js on http://nodejs.org/dist/ set the make_install parameter to false.

class { 'nodejs':
  version => 'v0.10.17',
  make_install => false,
}

or

nodejs::install { 'v0.10.17':
  version => 'v0.10.17',
  make_install => false,
}

NPM Provider

This module adds a new provider: npm. You can use it as usual:

package { 'express':
  provider => npm
}

Running the tests

Install the dependencies using Bundler:

BUNDLE_GEMFILE=.gemfile bundle install

Run the following command:

BUNDLE_GEMFILE=.gemfile bundle exec rake test

License

puppet-nodejs is released under the MIT License. See the bundled LICENSE file for details.