-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Add nvm (Node Version Manager) to PHP container tools #499
Comments
@az09asdf I will probably need a bit of support here as I am not too familiar with NodeJS and NVM. Currently I am already installing a couple of NodeJS packages via ( I think it is a general good idea to also have multiple NodeJS versions available, could you list a few common once, just that I get an idea here. |
while learning some front-end frameworks, sometimes it was a requirement to have the latest node version so, I found instruction for instaling node using nvm here, installed it on the php container, tried it and it looks good it is realy simple to install and use the first thing I do before installing nvm and node versions needed is to uninstall node from the php container: and then as per my previous post if your project needs version 11.10.0 (which you previously installed using and that's it: from now on you have that version on your php container
all juggling with installed node versions is handled by nvm the only thing which is changed is that on the devilbox home page now we have: I hope this will be of some help keep up the good work |
@az09asdf Thanks for the explanation. When uninstalling nodejs and npm, what will happen to the already globally installed npm packages? |
@cytopia However, according to https://github.com/creationix/nvm#system-version-of-node it seems that removing already installed version on node (pre nvm) is not needed: you could switch to it by That would mean you could just add nvm install after already installed stuff (node also) to PHP image and either leave it as it is or (better) at least install current LTS version of node ( The best course of action while creating PHP image might be as follows:
That way, user will have at least current LTS already installed, and if they need another node version - no problem, nvm is already installed so it is really easy to do (and how to for example transfer global packages to another version if you need them is described here). |
This is still needed. Would be nice to have it added. |
If it is still needed, feel free to use it then ;-) It is already available since a long time. Did you miss out any updates? $ devilbox@php-7.4.1 in /shared/httpd $ nvm --version
0.35.2 |
I was logging in as root and that is why the Sory for the mistake and thanks for your time :) |
I still get |
I ran the As Cytopia said in another issue, it seems to be because |
when trying to change the node version I get write permission errors: nvm install lts/* |
same permission issue when trying install current lts nvm install --lts |
For anyone running into the permission issue when trying to install node versions that are not available in the @cytopia |
I actually can't reproduce it on my side:
Everything is owned by |
@cytopia to reproduce it:
Changing the permission like I mentioned in the previous comment is what allows me to run the install though. (777 is a bit much, but it confirms the issue is somewhere with the permissions) The first error encountered suggest the root of the issue is in the creation of a new folder, which isn't allowed. |
That is exactly what I did. Everything works fine. |
I'm running php
I see my owner is different, looks like the default Docker user. |
With PHP_SERVER=8.1 Bildschirmaufnahme.2022-07-01.um.15.15.05.mov |
The owner does look different. Can you post the output from |
On my host
In devilbox
Interestingly, @krebbi seems to be on Mac OS too, wonder if that's causing the difference here |
OK, got it. Afaik the entrypoint script is not taking care about |
@cytopia You're awesome, thanks a bunch! |
The build will take quite a lot of hours though: devilbox/docker-php-fpm#243 |
Changing ownership during startup takes >5min, so I am changing file system permission during build time and make them wide open. Kinda dirty, but I don't see a better way. |
PR went through, now need to wait for the tagged build: https://github.com/devilbox/docker-php-fpm/releases/tag/0.141 |
Just FYI, did a test on my Linux machine, there was still and older PHP container there. On the Linux host this problem didn't occur at all it seems, so that explains why for some people it occurred and for others didn't. Thanks for fixing the issue for the other hosts. |
Reason is that by default the first user being created on Linux gets uid 1000 and gid 1000 (it increments with additional users). This is also the default uid/gid used inside the PHP container. |
Reopened as not yet released for Devilbox |
ISSUE TYPE
SUMMARY
Add nvm to PHP container tools (Ubuntu 18.04 example).
install nvm script:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
install the latest LTS version:
nvm install --lts
install the latest available version of node.js:
nvm install node
Goal
It would be nice to have multiple node.js versions to select from, instead of just the latest node.js lts version.
The text was updated successfully, but these errors were encountered: