Page MenuHomePhabricator

npm is missing from Stretch image
Closed, ResolvedPublic

Description

I reviewed a spreadsheet @Bstorm prepared highlighting the difference in versions between Trusty and Stretch and noticed that npm is missing from Stretch. This is probably going to be noticeable. @bd808 noted that npm has since been backported to Stretch.

Event Timeline

Harej triaged this task as Medium priority.Jan 4 2019, 11:23 PM
Harej created this task.
Harej removed a project: Epic.

🎉 That was something I was sure we were going to hear about. Great!

Using npm from stretch-backports is probably fine for now, though it's already a bit old. CI is in the process of switching to npm6 fwiw.

So either we should use the packaged npm to bootstrap a newer npm (npm install -g npm@6) or you can use https://gerrit.wikimedia.org/g/integration/npm which is the equivalent of integration/composer but for npm. The former would work well for docker images, but it doesn't work for dev hosts that provision packages via puppet...and using npm from two different areas with possibly different versions is going to be a mess so I'd recommend just using integration/npm everywhere.

Change 486099 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolforge: add npm to the stretch grid nodes

https://gerrit.wikimedia.org/r/486099

Change 486099 merged by Bstorm:
[operations/puppet@production] toolforge: add npm to the stretch grid nodes

https://gerrit.wikimedia.org/r/486099

Ok, that broke things. It's because the rest of node wasn't installed from backports. I'll have to try a pin or something there.

Change 486110 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolforge: ensure stretch grid nodes use backports for nodejs

https://gerrit.wikimedia.org/r/486110

Change 486110 merged by Bstorm:
[operations/puppet@production] toolforge: ensure stretch grid nodes use backports for nodejs

https://gerrit.wikimedia.org/r/486110

This is requiring a bit of fussing due to conflicts with non-backports node packages. The last version should work. We'll see.

Looks like nodejs-legacy package dislikes this arrangement. I'll have to see to that somehow.

Change 486124 had a related patch set uploaded (by Bstorm; owner: Bstorm):
[operations/puppet@production] toolforge: remove nodejs-legacy from the stretch grid

https://gerrit.wikimedia.org/r/486124

nodejs-legacy is literally just a symlink and some documentation. The symlink seems to be provided as is by the current packages without it now, so I'm dropping it. If we find it necessary, we can add the symlink via puppet.

Change 486124 merged by Bstorm:
[operations/puppet@production] toolforge: remove nodejs-legacy from the stretch grid

https://gerrit.wikimedia.org/r/486124

@Legoktm I'm not sure I like the idea of diverging from the debian versioning on the system level--though I admit I wish it were at least at the LTS level. There's a node 10 component available for wikimedia use, but it only upgrades core node to 10 (LTS), and I worry to some extent that could have unforeseen consequences with the broad use cases we have.

Looking at the webservice system, I'm quite glad @Harej brought up this whole issue since it depends on running npm to launch node apps on the grid :)

I think this is done for now. I updated the https://wikitech.wikimedia.org/wiki/News/Toolforge_Trusty_deprecation#What_are_the_primary_changes_with_moving_to_Stretch? bit.

If we need to push this envelope further to make the grid run more modern node than 8 and npm 5.8, we can revisit. I don't think there's a straightforward, puppetized way to do it just now.

If we need to push this envelope further to make the grid run more modern node than 8 and npm 5.8, we can revisit. I don't think there's a straightforward, puppetized way to do it just now.

I guess that would be T195103: Add Support for Node.js 10 LTS to Toolforge.

Ok, that broke things. It's because the rest of node wasn't installed from backports. I'll have to try a pin or something there.

Hi Brooke. Just the other day I ran into the same issues trying to get the combination of nodejs 10 and npm on the parsoid testing host. (T201366). I saw this ticket by chance and wanted to share because it seems to be the same thing.

This is requiring a bit of fussing due to conflicts with non-backports node packages. The last version should work. We'll see.

Yea, it was annoying but i eventually got to:

https://gerrit.wikimedia.org/r/#/c/operations/puppet/+/482150/4/modules/testreduce/manifests/init.pp

https://gerrit.wikimedia.org/r/#/c/operations/puppet/+/484811/

There's a node 10 component available for wikimedia use

Using just that in this example:

https://gerrit.wikimedia.org/r/#/c/operations/puppet/+/484579/

Looks like nodejs-legacy package dislikes this arrangement.

ACK, I ran into the same issue and ended up removing it from the service class:

https://gerrit.wikimedia.org/r/#/c/operations/puppet/+/483891/

After that i cleaned up my previous pinning config attempts..

mutante: scandium - deleting /etc/apt/preferences.d/stretch_backports.pref ; apt-get remove nodejs ; apt-get install -t stretch-backports npm ; now has nodejs 10 and npm from backports installed (T201366)

And now we have node 10 and npm:

mutante: scandium - puppet run now without errors for the first time for the parsoid testing role on stretch instead of jessie. nodejs 10