Git Product home page Git Product logo

Comments (8)

nibalizer avatar nibalizer commented on May 23, 2024

Can you try:

nodejs::npm { 'npm':
   ensure   => 'version',
   provider => npm,
}

from puppet-nodejs.

cubiclelord avatar cubiclelord commented on May 23, 2024

Looks like that errors out: Error 400 on SERVER: Invalid parameter provider on Nodejs::Npm[npm]

Looking at the nodejs::npm defined type shows that there isn't a provider parameter.

I tried this also:

  nodejs::npm { 'npm':
    ensure => '2.13.4',
    target => '/usr/bin',
  }

But that also dies, trying to install npm from the default package manager, instead of from npm.

from puppet-nodejs.

nibalizer avatar nibalizer commented on May 23, 2024

Oh right maybe:

package { 'npm':
  ensure => '2.13.4',
  provider => npm,
}

from puppet-nodejs.

cubiclelord avatar cubiclelord commented on May 23, 2024

That's what I tried at first, but I got a duplicate resource error because Package[npm] is already defined in install.pp on line 49. Now that I look at it again, maybe I can set $nodejs::npm_package_name to undef and then that whole package section won't be in affect.

from puppet-nodejs.

cubiclelord avatar cubiclelord commented on May 23, 2024

Hmm, I tried this, but I still got Duplicate Declaration: Package[npm] is already declared

class profile::appserver::nodejstools {
  class { 'nodejs':
    # Other nodejs values are set in hiera, but undef can't be set in hiera
    npm_package_name => undef,
  }

  package { 'npm':
    ensure   => '2.13.4',
    provider => 'npm',
  }
}

from puppet-nodejs.

nibalizer avatar nibalizer commented on May 23, 2024

That makes sense. This is a legitimate deficiency in the software, and one that affects me as well.

from puppet-nodejs.

petems avatar petems commented on May 23, 2024

This would only be achievable in Puppet > 4 😢
(See https://tickets.puppetlabs.com/browse/PUP-1073 for the full story)

In Puppet > 4:

class profile::appserver::nodejstools {
  include nodejs

  package { "npm-installed-with-npm":
    name     => "npm",
    provider => "npm",
    ensure   => "2.13.4",
    require   => Class['nodejs'],
  }

}

from puppet-nodejs.

gytisgreitai avatar gytisgreitai commented on May 23, 2024

any updates on this?

My current workaround:

    exec { 'upgrade npm to v3:
        command => 'sudo env "PATH=$PATH" npm install npm -g',
        onlyif  => "test `npm -v | awk -F \. {'print $1'}` -lt 3",
    }

from puppet-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.