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

Update NodeJS version to most recent LTS (4.2.x) #788

Closed
morganestes opened this issue Nov 20, 2015 · 12 comments
Closed

Update NodeJS version to most recent LTS (4.2.x) #788

morganestes opened this issue Nov 20, 2015 · 12 comments

Comments

@morganestes
Copy link

During a provision, one of the packages complains about having an outdated version of node. Normally that's not a major blocker, but since the regular nodejs package installs v.0.10.x and Node LTS stable is now at 4.2.2, I think moving to that version is safe for general use. I'm open to other ideas, including installing v0.12.x, if there's a compelling reason not to go with 4.x.

Following the guidance at https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions, I've tested swapping out the existing nodejs sources from Ubuntu to NodeSource and it seems to be working okay. Next up is updating the provisioning script to install it properly.

@cfoellmann
Copy link
Member

sounds good. Just send a PR so we can test it.

@ntwb
Copy link
Contributor

ntwb commented Nov 29, 2015

I've just come across this myself...

I'll take a look at the provisioning script to see what can be done to both provision and upgrade existing NodeJS installs next week sometime(hopefully)

FYI: The original NodeJS was switched to Chris Lea's Launchpad PPA in 803b7d8

@morganestes
Copy link
Author

I haven't had much luck getting it to work as part of the provisioning script for upgrade/change, but can get it to work for fresh installs. I don't think we should require folks to destroy just to swap sources, so I'm still looking for better solutions.

So far, I've tried two approaches: 1) dropping in the script directly from https://raw.githubusercontent.com/nodesource/distributions/master/deb/setup_4.x into provision.sh and letting it do the work, and 2) adding the PPA to the custom sources, adding the keys to provision.sh, and letting the normal provision process use the new deb.nodesource.com release.

@ericandrewlewis
Copy link
Contributor

How would a PHP (or another system package) upgrade be handled in VVV?

@morganestes
Copy link
Author

@ericandrewlewis I believe you can add it to the provision process using provision-post.sh to install your desired version, or through apt-get in the shell once it's provisioned. Either one would require Ubuntu to have an updated version in their repo, or a custom PPA set up to pull from.

From https://askubuntu.com/questions/109404/how-do-i-install-latest-php-in-supported-ubuntu-versions-like-5-4-x-in-ubuntu-1:

sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5

@thebrandonallen
Copy link
Contributor

I submitted a pull request for switching to NodeSource a while back. Looking for feedback. See #779

@jeremyfelt
Copy link
Member

I'll take a closer look at #779 to resolve this. We should be able to find some way to cleanly update without driving ourselves crazy. :)

: How would a PHP (or another system package) upgrade be handled in VVV?

@ericandrewlewis This is one of our worst non-features right now. In something like Salt I would define php-fpm as pkg.latest and it would always look for an update whenever vagrant provision fires. Right now we only install if not installed, so the options are to manually do it or destroy and start over. I'd very much like to update that to support apt-get update every time.

@ntwb
Copy link
Contributor

ntwb commented Apr 5, 2016

I just patched #779 directly into my fresh VVV install (MY previous nstall broke 😢 )

After an initial vagrant up I added #779, and vagrant up --provision:

==> default: Linked custom apt sources
==> default: Applying NodeSource NodeJS signing key...
==> default: OK
==> default: No apt packages to install.
==> default: /usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
==> default: /usr/lib
==> default: └── [email protected] 

What version of NodeJS do we have? node -v = v0.10.37

OK, sudo apt update && sudo apt upgrade --show-upgraded or vagrant up --provision:

What version of NodeJS do we have? node -v = v0.12.13 ✔️

So the above gets NodeJS updated to v0.12.x branch, and #863 gets nvm installed so you can switch NodeJS versions any time you want, or use/test specific versions of NodeJS using nvm 👍

@ericandrewlewis
Copy link
Contributor

So the above gets NodeJS updated to v0.12.x branch, and #863 gets nvm installed so you can switch NodeJS versions any time you want, or use/test specific versions of NodeJS using nvm

Can we default to latest stable (v5.0.x)?

@ntwb
Copy link
Contributor

ntwb commented Apr 5, 2016

Can we default to latest stable (v5.0.x)?

The current plan for core will be the 4.x LTS branch, discussion in #35105

I'm thinking 4.x.x LTS should also be the default for VVV, with NVM you can switch to 5.x if you so chose, my thinking here is a base of LTS versions if we can rather than bleeding edge, be it Node, NPM, Grunt, Git, SVN etc.

I ran apt update && apt upgrade --show-upgraded via vagrant ssh for the first time in maybe a year today, I doubt I'm the only one who rarely, if ever does that.

Typically VVV just works and by using LTS branches this would bring that same stability and reliability to VVV without having to update VVV constantly, either as a user, or the project as a whole.

@jeremyfelt
Copy link
Member

4.2.x is now installed via #779.

vagrant@vvv:~$ node --version
v4.5.0
vagrant@vvv:~$ npm --version
3.10.6
vagrant@vvv:~$ nvm --version
0.31.4

@lock
Copy link

lock bot commented Feb 22, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants