sous-chefs/nodejs

Error on debian 7.6

Closed this issue · 3 comments

Hello,

I have the fallowing error on debian 7.6 / Vbox / Vagrant on the first run :

==> default: ================================================================================
==> default: Error executing action `install` on resource 'package[nodejs]'
==> default: ================================================================================
==> default:
==> default:
==> default: Mixlib::ShellOut::ShellCommandFailed
==> default: ------------------------------------
==> default: Expected process to exit with [0], but received '100'
==> default: ---- Begin output of apt-cache policy nodejs ----
==> default: STDOUT:
==> default: STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/node.js.list (dist parse)
==> default: E: The list of sources could not be read.
==> default: E: The package lists or status file could not be parsed or opened.

The problem is :

$ sudo cat /etc/apt/sources.list.d/node.js.list
deb     https://deb.nodesource.com/node  main

The attribute node['lsb']['codename'] is empty :/

@nasga sorry but this is a problem with Ohai who provide this attribute. :/

Just a note to help if anyone else has this problem:
The lsb attributes are filled only if you have the "lsb-release" package installed.
IMO the distribution name should be parsed manually, like chef-sugar (https://github.com/sethvargo/chef-sugar/blob/master/lib/chef/sugar/platform.rb) does, but I understand wanting to just use something filled by ohai.

same on debian jessie

it creates source list:

/chef# cat /etc/apt/sources.list.d/node.js.list
deb      "https://deb.nodesource.com/node_6.x" main

That results in error:

STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/node.js.list (dist parse)
E: The list of sources could not be read.

and fixing to deb "https://deb.nodesource.com/node_6.x" jessie main make work.

So how to use nodejs cookbook to make it work properly?