This module allows to install Node.js and NPM. This module is published on the Puppet Forge as willdurand/nodejs.
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
This modules depends on puppetlabs/stdlib and maestrodev/puppet-wget. You MUST clone them if you don't use the Puppet Module Tool:
git clone git://github.com/puppetlabs/puppetlabs-stdlib.git modules/stdlib
git clone git://github.com/maestrodev/puppet-wget.git modules/wget
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 a symlink for the node binary (and npm) with Node.js version appended into /usr/local/bin
e.g. /usr/local/bin/node-v0.10.17
.
You can change this behavior by using the target_dir
parameter.
Using the nodejs class, binary files are exposed to the system $PATH without a version string appended.
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,
}
This module adds a new provider: npm
. You can use it as usual:
package { 'express':
provider => npm
}
Install the dependencies using Bundler:
BUNDLE_GEMFILE=.gemfile bundle install
Run the following command:
BUNDLE_GEMFILE=.gemfile bundle exec rake test
- William Durand [email protected]
- Johannes Graf (@grafjo)
puppet-nodejs is released under the MIT License. See the bundled LICENSE file for details.