2

I have the following puppet manifest file:

include nodejs

package { 'yo':
  ensure => present,
  provider => 'npm',
  require => Class["nodejs"],
}

This produces the following error:

notice: /Stage[main]/Nodejs/Package[nodejs]/ensure: ensure changed 'purged' to 'present'
err: /Stage[main]/Yeoman/Package[bower]/ensure: change from absent to present failed: Command npm is missing
err: /Stage[main]/Yeoman/Package[yo]/ensure: change from absent to present failed: Command npm is missing

I would have thought including nodejs would have installed npm. Do you know what I am missing?

Thanks!

Karan
  • 14,824
  • 24
  • 91
  • 157
  • From the terminal, if you use `whereis npm`, what is the result? – WiredPrairie Nov 17 '13 at 16:37
  • whereis npm shows me that there is no npm installed. I believe nodejs was installed using 'include nodejs' - but perhaps I may have previously installed it as a package. I will try running this on a fresh environment – Karan Nov 17 '13 at 16:46
  • Tried it on a fresh environment - I get the same error. I have updated the error message to show the notice stating that nodejs was installed too. Not sure why the npm provider isn't installed – Karan Nov 17 '13 at 16:56
  • Try http://stackoverflow.com/a/13332245/95190 – WiredPrairie Nov 17 '13 at 17:43
  • Yeah, I saw that. My package does have the require => Class["nodejs"] - so I would have presumed that nodejs was installed before 'yo'. I tried changing the require to Package['npm'] - but that doesn't seem to be defined anywhere (and hence throws up an error) – Karan Nov 17 '13 at 18:53
  • which version of nodejs is being installed? it is highly unlikely, but is it possible that npm is just not included in this nodejs package? – Evgeny Chernyavskiy Nov 17 '13 at 22:04
  • I think it's version: v0.10.22 (not 100% sure since it node may have been installed by the package manager below ... will confirm) – Karan Nov 20 '13 at 12:04

1 Answers1

1

I had the same problem and ended up using https://forge.puppetlabs.com/willdurand/nodejs worked perfectly (as wget as dependancy tho ).

silkAdmin
  • 4,640
  • 10
  • 52
  • 83
  • seems to run without errors, but doesn't seem that the packages are installed. I have posted a new question about this - will let you know as soon as I understand what's going on. http://stackoverflow.com/questions/20095247/puppet-installing-packages-but-these-do-not-seem-to-work – Karan Nov 20 '13 at 12:03