1

I am attempting to do the following in puppet:

package { 'bower':
    ensure   => present,
    provider => 'npm',
    require  => Class['nodejs'],
    before   => [ Exec['npm_install'], Exec['grunt_build'] ],
}

This gives me the error:

err: Failed to apply catalog: Parameter provider failed on Package[bower]: Invalid package provider 'npm' at 

I have tried using both puppetlabs-nodejs and willdurand-nodejs without success and have also manually installed npm then tried to apply the above.

spetz
  • 90
  • 1
  • 7

1 Answers1

0

I wrote my own class to install node but used puppetlabs-nodejs custom provider https://github.com/puppetlabs/puppetlabs-nodejs/blob/master/lib/puppet/provider/package/npm.rb

It seems that as per https://puppet.com/docs/puppet/latest/plugins_in_modules.html pluginsync = true needs be added to /etc/puppet/puppet.conf on the nodes.

рüффп
  • 620
  • 1
  • 11
  • 24
spetz
  • 90
  • 1
  • 7
  • Please note that this has been default for years. Are you using an ancient release of Puppet? Or do you use packages from an ill maintained source? – Felix Frank Oct 26 '14 at 00:53
  • I am using 2.7.25 which is provided by Amazon Linux repos. Should I be using the puppet repo instead? First time I tried that I ran into some issues and stuff to using the version in the amazon repo. – spetz Oct 27 '14 at 16:21
  • I see. In `2.7.25`, the setting was indeed not yet the default upstream. But most packagers included the setting in the stock `puppet.conf` that came with the package, if I recall correctly. Amazon did not, evidently. - Do consider switching to a source that offers more recent packages. You may encounter modules that are not compatible with `2.7.x`. – Felix Frank Oct 27 '14 at 19:53