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 version under ubuntu #48

Closed
piotrrepetowski opened this issue Sep 12, 2013 · 7 comments
Closed

Nodejs version under ubuntu #48

piotrrepetowski opened this issue Sep 12, 2013 · 7 comments

Comments

@piotrrepetowski
Copy link

Guys I have a question:

Is there a way to disable node.js-devel repo for Ubuntu? Now when I install nodejs through puppet with:

class { "nodejs":
version => "latest",
manage_repo => true,
}

I get newest version of nodejs from node.js-devel but I want to use stable version.

I don't understand why you added both repositories.

Best regards.

@philfreo
Copy link

Agreed... not able to install the latest stable version on Ubuntu 12.04. Using the master version of this module.

@philfreo
Copy link

Actually, I can install the latest stable version (0.10.18) but I have to specify this funky string, rather than 'latest' or even just '0.10.21':

  class { 'nodejs':
    version     => '0.10.21-1chl1~precise1', # found from https://launchpad.net/~chris-lea/+archive/node.js
    manage_repo => true,
  }

@piotrrepetowski
Copy link
Author

That's true @philfreo.

My workaround was to directly install "nodejs" via apt before touching any npm managed package:

apt::ppa { 'ppa:chris-lea/node.js-devel': }

package { "nodejs":
    ensure => "present"
    require => Class["apt"]
}

And after that I normally used package with "npm" provider.

@blakeharv
Copy link

Bleah, finally got it working. Here is some updated info:

And here's what final worked for me:

# Set the PPA package
apt::ppa { 'ppa:chris-lea/node.js': }

apt::ppa { 'ppa:chris-lea/node.js':
  before => Exec['apt-get update']
}

exec { 'apt-get update':
  command => '/usr/bin/apt-get update'
}

# Specify your  linux version (from the above link)
package { 'nodejs':
  ensure => '0.10.19-1chl1~precise1',
  require => Exec["apt-get update"]
}

# Add additional Node packages
package { 'grunt-cli':
  ensure   => present,
  provider => 'npm',
  require => Package['nodejs']
}

@piotrrepetowski
Copy link
Author

The problem is that you need to specify this strange version string. If you don't do that you will get unstable nodejs installed on your ubuntu and you will need to change it when new version will be released.

What do you think about adding some parameter "unstable" for class parameters? But now I'm not sure how this will work for other distributions.

@codesplicer
Copy link

Added a pull request related to this issue: /pull/62

If $manage_repo is true then this module will install the latest stable, if both $manage_repo and $dev_package are true then it will install the unstable version.

NB - the PPA can only ever track the latest stable releases, historic versions aren't kept in the repo thanks to the way launchpad works, so manually specifying a version string will fail the puppet run if the PPA version has advanced.

@juniorsysadmin
Copy link
Member

The most recent 0.10.x version should now be installed by default, but if you have sufficient bandages for cuts to your fingers you should also be able to install 0.12.x on Debian-based platforms with repo_url_suffix => 'node_0.12'.

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

No branches or pull requests

5 participants