Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add package_versions attribute #65

wants to merge 1 commit into from

2 participants


The install_from_package recipe doesn't provide a way to specify versions. Since versions for distro packages will be different from versions of node.js itself, this attribute is a hash of distro package name => distro package version. You need to know what distro packages you will be installing.

If you don't set anything, then the package resource will just get version nil and default to the latest version as it does now.

Example usage:

node.set['nodejs']['package_versions']['nodejs'] = value_for_platform('ubuntu' => {
    '10.04' => '0.10.21-1chl1~lucid1',
    '12.04' => '0.10.21-1chl1~precise1',

include_recipe 'nodejs::install_from_package'

Do any of the existing default repositories provide multiple package versions? As this is nice but because of that I would say it is unusable unless if you have your own custom repo. Let me know what you think.


The development of the nodejs cookbook has been move here:
Your PR functionality might have been already included in the new repo. If not, please resubmit it there. Thanks!

@mdxp mdxp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
1 
@@ -31,6 +31,7 @@ ATTRIBUTES
* nodejs['npm'] - version of npm to install
* nodejs['npm_src_url'] - download location for npm source tarball
* nodejs['check_sha'] - test for valid sha_sum, default: true
+* nodejs['package_versions'] - distro versions of packages to install
3  attributes/default.rb
@@ -36,3 +36,6 @@
# Set this to true to install the legacy packages (0.8.x) from ubuntu/debian repositories; default is false (using the latest stable 0.10.x)
default['nodejs']['legacy_packages'] = false
+# If installing from packages, set attributes here to install specific versions. legacy packages have separate nodejs and npm packages, current just has nodejs.
+default['nodejs']['package_versions'] = {}
4 recipes/install_from_package.rb
@@ -48,5 +48,7 @@
packages.each do |node_pkg|
- package node_pkg
+ package node_pkg do
+ version node['nodejs']['package_versions'][node_pkg]
+ end
Something went wrong with that request. Please try again.