voxpupuli / puppet-nodejs

Puppet module to install nodejs and global npm packages
https://forge.puppet.com/puppet/nodejs
Apache License 2.0
113 stars 248 forks source link

Missing dependency on package resource that installs NPM when using the nodesource repository #404

Closed wiebe closed 3 years ago

wiebe commented 4 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Try to set a global_config_entry before the nodejs/npm package is being installed. As an example:

nodejs::npm::global_config_entry { 'always-auth':
   ensure => 'present',
   value  => 'true',
}

What are you seeing

The npm_config exec fails and the config is not set.

What behaviour did you expect instead

For the resource to apply without errors.

Output log

Error: /bin/sh: 1: /usr/bin/npm: not found

Error: /Nodejs::Npm::Global_config_entry[always-auth]/Exec[npm_config present always-auth]/returns: change from 'notrun' to ['0'] failed: /bin/sh: 1: /usr/bin/npm: not found

Any additional information you'd like to impart

I implemented a simple fix, will make a pull request.

juniorsysadmin commented 3 years ago

Fixed by #405