Downloading an NPM Package with a Chef

I am new to Chef and follow this guide ( 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 located under the coobooks / zombie / recipes / directory, and all other files are in the top-level chef's folder). I ran the install.sh script, which basically installs ruby ​​and chef, and then produces "chef-solo -c solo.rb -j solo.json", but got this error:

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

I think that I am referring incorrectly to the npm package or including the specific node package (Mocha). Can someone please give me any recommendations on this error? Thank.


My default.rb file:

package 'nodejs'
package 'npm'

include_recipe "npm"

npm_package "default" do
  enable true
end

npm_package "mocha@1.17.1"

My solo.json file:

{
    "run_list": [ "recipe[npm]", "recipe[zombie::default]" ]
}
+3
source share
1 answer

You need the npm cookbook in the catalog cookbooks/. You can grab it from here

Btw, this tutorial is excellent, helps to lay a lot of fundamental understanding of the chef ecosystem.

+2
source

All Articles