Skip to content

Issue with nodejs repo and npm package conflict #452

@AxisNL

Description

@AxisNL

I'm pulling my hair out on issues with npm and nodejs on my Ubuntu 20.04.03 LTS machines..

If I run:

  class { 'nodejs':
    manage_package_repo => true,
  }

The nodesource repo will be added (which is fine), then the nodejs package will be installed (which is fine). The nodesource nodejs package provides npm. Perfect!

At this point, dpkg -l will show the nodejs package being installed, and the npm package isn't installed.

But, after this, puppet will remove the npm package, since the default setting for npm_package_ensure is absent. This somehow removes the nodejs package (not fine). No idea how this works, since according to apt the npm package isnt installed. But puppet says:

Notice: /Stage[main]/Nodejs::Install/Package[npm]/ensure: removed (corrective)

And /usr/bin/npm is gone, as is the nodejs package.

If I do:

  class { 'nodejs':
    manage_package_repo => true,
    npm_package_ensure => true
  }

Then that will fail. Nodejs will be installed from the nodesource repo, but the npm package only exists in the Ubuntu repo's, and that cannot be installed because it conflicts with the nodesource nodejs package.

So I'm in kind of a loop here!

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.12.1
  • Ruby: ?
  • Distribution: Ubuntu 20.04
  • Module version: 9.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions