我有以下表現:流浪,木偶和模塊的NodeJS:在NPM模塊安裝拋出錯誤
include nodejs
package { 'serve':
ensure => latest,
provider => 'npm',
}
我使用Node.js的puppetlab模塊:
http://forge.puppetlabs.com/puppetlabs/nodejs
Vagrantfile:
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = '~/work/environments/default/'
puppet.manifest_file = 'site.pp'
puppet.module_path = '~/work/environments/default/modules'
end
end
當我運行vagrant up
我得到以下錯誤:
[default] Running provisioner: Vagrant::Provisioners::Puppet...
[default] Running Puppet with /tmp/vagrant-puppet/manifests/site.pp...
stdin: is not a tty
err: /Stage[main]//Package[serve]/ensure: change from absent to latest failed: Could not update: Got nil value for ensure at /tmp/vagrant-puppet/manifests/site.pp:6
notice: /Stage[main]/Nodejs/Package[nodejs]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Nodejs/Package[npm]/ensure: ensure changed 'purged' to 'present'
notice: Finished catalog run in 14.89 seconds
起初我想,也許它正試圖安裝NPM之前安裝的「服務」模塊,所以我嘗試require => Package[npm]
但給了相同的結果。
因此,任何人都可以關注爲什麼不安裝'serve'模塊?
您如何要求Package ['npm']?它似乎沒有被定義(「無法找到依賴包[npm]」) – Karan
你可以做「require => Class ['nodejs'],」 –