sous-chefs/nodejs

Wrong package installed with default repo on Ubuntu 16.04 LTS

Opened this issue · 3 comments

When installing from packages on Ubuntu 16.04 LTS with default repo we get nodejs-4.2.6~dfsg-1ubuntu4.1 package from Ubuntu repo instead of deb.nodesource.com. The apt-cache policy nodejs output:

nodejs:
  Installed: (none)
  Candidate: 4.2.6~dfsg-1ubuntu4.1
  Version table:
     4.2.6~dfsg-1ubuntu4.1 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
     4.2.6~dfsg-1ubuntu4 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
     0.10.46-1nodesource1~xenial1 500
        500 https://deb.nodesource.com/node xenial/main amd64 Packages

The fix is to set node['nodejs']['repo'] = 'https://deb.nodesource.com/node_6.x' (default repo is https://deb.nodesource.com/node)

An easy way to correct this is to specify a major version in the attributes/default.rb like default['nodejs']['version'] = '6' which will get interpolated into the URL and allow installing the intended version of NodeJS.

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.

Adding default repository as this cookbook does in the repo recipe seems to cause this issue. I believe the cookbook is working as designed ( the design may be bad but that's a separate issue.)