Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodejs::npm::global_config_entry cannot work on a platform that puts npm into a different path #434

Closed
igalic opened this issue Nov 16, 2020 · 0 comments · Fixed by #435
Closed

Comments

@igalic
Copy link
Contributor

igalic commented Nov 16, 2020

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.19.1
  • Ruby: 2.6.5
  • Distribution: FreeBSD
  • Module version: 8.1.0

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

  class { 'nodejs':
    nodejs_package_name => 'node12',
    npm_package_name    => 'npm-node12',
    npm_path            => '/usr/local/bin/npm'
  }

  nodejs::npm::global_config_entry { 'unsafe-perm':
    ensure => 'present',
    value  => 'true',
  }

What are you seeing

All of my nodejs::npm::global_config_entry are failing, because the code isn't made to run on anything the author didn't anticipate. but it comes down to two things:

define nodejs::npm::global_config_entry (
  Enum['present', 'absent'] $ensure = 'present',
  $config_setting                   = $title,
  $cmd_exe_path                     = $nodejs::cmd_exe_path,
  $npm_path                         = $nodejs::params::npm_path,
  $value                            = undef,
) {
  include nodejs

npm_path defaults to $nodejs::params::npm_path rather than $nodejs::npm_path, which is wrong.
$nodejs::params::npm_path for FreeBSD is also set to /usr/bin/npm rather than /usr/local/bin/npm.

next, we have a hard-coded path of /usr/bin/test, which on FreeBSD is located in /bin/test.

Both of these seem… unnecessary. If the PATH is correct, we shouldn't have to hard-code path, unless they are extremely esoteric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant