Forge Home

nodejs

Configure nodejs via Boxen

9,194 downloads

7,519 latest version

4.6 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

  • 5.0.4 (latest)
  • 5.0.3
  • 5.0.2
  • 5.0.1
released Jan 16th 2016
This version is compatible with:
  • Darwin

Start using this module

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

Add this module to your Puppetfile:

mod 'halyard-nodejs', '5.0.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install halyard-nodejs --version 5.0.4

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

Documentation

halyard/nodejs — version 5.0.4 Jan 16th 2016

puppet-nodejs

Puppet Forge Dependency Status MIT Licensed Build Status

Module to handle nodejs version management with nodenv for boxen, based on boxen's ruby module

Changes from upstream

  • Clean up meta files
  • Set up CircleCI builds
  • Switch to function bindings vs puppet-module-data

Usage

In your hiera config:

"nodejs::provider": "nodenv"
"nodejs::user": "deploy"

# https://github.com/OiNutter/node-build/releases
"nodejs::build::ensure": "f18b3d67756d1cb25ba6e35044f816fd67211b33"
"nodejs::nodenv::ensure": "v0.2.0"

# nodenv plugins
"nodejs::nodenv::plugins":
  "nodenv-vars":
    "ensure": "ee42cd9db3f3fca2a77862ae05a410947c33ba09"
    "source": "OiNutter/nodenv-vars"

# Environment variables for building specific versions
# You'll want to enable hiera's "deeper" merge strategy
# See http://docs.puppetlabs.com/hiera/1/configuring.html#mergebehavior
"nodejs::version::env":
  "0.4.2":
    "CC": "gcc"

# Version aliases, commonly used to bless a specific version
# Use the "deeper" merge strategy, as with nodejs::version::env
"nodejs::version::alias":
  "0.10": "0.10.36"
  "0.12": "0.12.0"
  "iojs-1.6": "iojs-1.6.2"

In your manifest:

# Set the global default node (auto-installs it if it can)
class { 'nodejs::global':
  version => '0.12'
}

# ensure a certain node version is used in a dir
nodejs::local { '/path/to/some/project':
  version => '0.12'
}

# ensure a npm module is installed for a certain node version
# note, you can't have duplicate resource names so you have to name like so
$version = "0.12"
npm_module { "bower for ${version}":
  module       => 'bower',
  version      => '~> 1.4.1',
  node_version => $version,
}

# ensure a module is installed for all node versions
npm_module { 'bower for all nodes':
  module       => 'bower',
  version      => '~> 1.4.1',
  node_version => '*',
}

# install a node version
nodejs::version { '0.12.2': }

# Installing nodenv plugin
nodejs::nodenv::plugin { 'nodenv-vars':
  ensure => 'ee42cd9db3f3fca2a77862ae05a410947c33ba09',
  source  => 'OiNutter/nodenv-vars'
}

Required Puppet Modules