Installing the Latest Node.JS And NPM Modules With Puppet
Join the DZone community and get the full member experience.
Join For FreePuppetLabs’ nodejs module is unfortunately quite out of date, providing Node.js 0.6, however there is a simple way to get the latest Node:
- Install the puppetlabs-apt module
- Add ppa:chris-lea/node.js to apt
- Install nodejs
- Steal the npm provider from the puppetlabs-nodejs module
- Install a npm module
Code:
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 wget https://raw.github.com/puppetlabs/puppetlabs-nodejs/master/lib/puppet/provider/package/npm.rb
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'], }
Node.js
Npm (software)
Published at DZone with permission of Jakub Holý, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
Mastering Time Series Analysis: Techniques, Models, and Strategies
-
Competing Consumers With Spring Boot and Hazelcast
-
Extending Java APIs: Add Missing Features Without the Hassle
-
Transactional Outbox Patterns Step by Step With Spring and Kotlin
Comments