Puppet installing packages, but these do not seem

2019-05-10 23:18发布

问题:

I have the following puppet file. It seems to have installed everything without errors, but commands such as yo or bower dont seem to work. Any idea why?

class yeoman {
    Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }

    $yeomanPackages = ["git", "rubygems", "libjpeg-turbo-progs", "optipng", "phantomjs", "python-software-properties" ]

    package { $yeomanPackages:
      ensure => "installed",
      require => Exec['apt-get update'],
    }
    exec { "apt-get update":
      command => "/usr/bin/apt-get update"
    }
    package { 'compass':
      ensure   => latest,
      provider => 'gem',
      require  =>  Package["rubygems"],
    }
    package { 'yo':
      ensure => present,
      provider => 'npm',
      require => Class["nodejs"],
    }
    package { 'grunt-cli':
      ensure => present,
      provider => 'npm',
      require => Class["nodejs"],
    }
    package { 'bower':
      ensure => present,
      provider => 'npm',
      require => Class["nodejs"],
    }
}
include nodejs
include yeoman

I have used the following nodejs module: https://forge.puppetlabs.com/willdurand/nodejs

Running yo / bower prints out:

-bash: yo: command not found

Thanks!