3
votes

I'm new to Chef and followed this tutorial (http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/) in which I created 4 files: install.sh, solo.json, solo.rb and default.rb. (default.rb is under the directory coobooks/zombie/recipes/ and all other files are under a top level chef directory). I ran the install.sh script which basically installs ruby and chef and then issues "chef-solo -c solo.rb -j solo.json" but got this error:

"ERROR: Cookbook npm not found. If you're loading npm from another cookbook, make sure you configure the dependency in your metadata."

I think I'm incorrectly referencing the npm package or including a particular node package (Mocha) the wrong way. Can anyone please give me any guidance on this error? Thanks.


My default.rb file:

package 'nodejs'
package 'npm'

include_recipe "npm"

npm_package "default" do
  enable true
end

npm_package "[email protected]"

My solo.json file:

{
    "run_list": [ "recipe[npm]", "recipe[zombie::default]" ]
}
1

1 Answers

2
votes

You need to an the npm cookbook to the cookbooks/ directory. You can grab it from here

Btw, that tutorial is great, helps lay down a lot of the fundamental understanding of the chef ecosystem.