-
-
Notifications
You must be signed in to change notification settings - Fork 242
Description
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 7.25 (Puppetlabs)
- Distribution: Debian 11
- Module version: 9.0.1
How to reproduce (e.g Puppet code you use)
class { '::nodejs':
repo_url_suffix => '16.x',
manage_package_repo => true,
}
What are you seeing
Starting from a machine which has no node or npm installed at all.
On the first Puppet run when adding the nodejs class to the machine, the nodesource apt repo configuration is added. Node is installed from Debian sources (not the 3rd party repo) along with a zillion node-* support packages. The npm package is pulled in by this, I believe, then removed by the Puppet module at the end of the run.
I run apt-get upgrade to install available updates. This, now using the nodesource apt repo, will remove all packages pulled in earlier and replace them by a single nodejs package in version 16, as requested.
On every Puppet run after this upgrade happened, the module now tries to install the npm package from Debian's repositories, which conflicts with the nodesource nodejs package (which already contains its own npm, it is not a separate package). The Puppet run fails due to this error.
Setting npm_package_ensure to absent makes no difference to this behaviour.
What behaviour did you expect instead
Installation of node v16 (preferrably immediately), but more importantly, non-failing Puppet runs after this has happened.
Output log
Info: Applying configuration version '1687605455'
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install npm' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libnode72 : Conflicts: nodejs-legacy
nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages.