0
votes

Basically, i need a working machine with node.js & npm installed. I've configured a vagrant + berkshelf + chef enviroment, but i can't find a lastest version (>= 4.0.0) nodejs cookbook as source for my berksfile. I've tried with this:

https://supermarket.chef.io/cookbooks/nodejs

from chef supermarket but install a old version of node + npm. I am experiencing for the first time vagrant and chef so i can't understand how find it. Can someone help me?

1

1 Answers

0
votes

In your role or node settings you can specify default attributes for any cookbook you use. Cookbook nodejs allows you to set NodeJS version with the attribute version (check its attributes/default.rb file). But this attribute is taken into account only when NodeJS is installed from precompiled binaries or sources. So you need to specify install_method as well (default is package, i.e. installation via system package manager).

One more thing: you need to manually specify binary package checksum, which you can find in every release folder here: https://nodejs.org/download/release/

So, to install the latest version from official binaries use the following settings in role or node:

"nodejs": {
  "install_method": "binary",
  "binary": {
    "checksum": "75b029b30d4a4147d67cf75bf6e034291fb5919c6935ec23f8365cee2d463f12"
  },
  "version": "5.3.0"
}