linuxserver / docker-mods

Documentation and Examples of base container modifications
GNU General Public License v3.0
1.03k stars 273 forks source link

code-server-nodejs mod: npm version is outdated #573

Closed phirestalker closed 1 year ago

phirestalker commented 1 year ago

I did an image pull only last week, so my image is pretty up to date. I just installed something with npm in the code-server console with one of my projects loaded. It informed me New major version of npm available! 6.14.17 → 9.4.0. That is a big jump. I was under the impression that nodejs was updated each time I rebuilt the image?

Can something be added to this mod so that it updates npm along with nodejs?

thespad commented 1 year ago

The mod specifically installs node 14, with whatever version of npm comes along with it

https://github.com/linuxserver/docker-mods/blob/code-server-nodejs/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-nodejs-add-package/run#L11

It does probably need bumping, but we need to be careful about people who are expecting it to remain version 14. Might be something we can make configurable.

phirestalker commented 1 year ago

That makes sense. A configurable option would be awesome. I guess we could make it the node version number we want installed?

On Wed, Feb 1, 2023 at 5:23 PM Adam @.***> wrote:

The mod specifically installs node 14, with whatever version of npm comes along with it

https://github.com/linuxserver/docker-mods/blob/code-server-nodejs/root/etc/s6-overlay/s6-rc.d/init-mod-code-server-nodejs-add-package/run#L11

It does probably need bumping, but we need to be careful about people who are expecting it to remain version 14. Might be something we can make configurable.

— Reply to this email directly, view it on GitHub https://github.com/linuxserver/docker-mods/issues/573#issuecomment-1412954702, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZBOZY22PWLZTOF4BSATRDWVL47ZANCNFSM6AAAAAAUOKYQRI . You are receiving this because you authored the thread.Message ID: @.***>

Roxedus commented 1 year ago

As this is a system-wide install, allowing to install any node version may break code-server itself.

thespad commented 1 year ago

Looks like 16.x is the currently supported version for code-server https://github.com/coder/code-server/blob/main/docs/npm.md#nodejs-version

aptalca commented 1 year ago

Did you give this a try? https://github.com/linuxserver/docker-mods/tree/code-server-nvm

phirestalker commented 1 year ago

Did you give this a try? https://github.com/linuxserver/docker-mods/tree/code-server-nvm

Do I use this instead of code-server-nodejs or use both?

EDIT: nevermind, figured it out.

Yukigamine commented 1 year ago

Did you give this a try? https://github.com/linuxserver/docker-mods/tree/code-server-nvm

Do I use this instead of code-server-nodejs or use both?

EDIT: nevermind, figured it out.

What ended up working for you?

EDIT: Using NVM instead of code-server-nodejs works.

aptalca commented 1 year ago

Nodejs mod is being updated to support passing the desired node version in an env var called NODEJS_MOD_VERSION

https://github.com/linuxserver/docker-mods/pull/642 should be merged within a day or so