overthesun / simoc-web

This is the web interface to SIMOC
https://ngs.simoc.space/
Other
3 stars 0 forks source link

Update npm version in the dev container #109

Closed ezio-melotti closed 3 years ago

ezio-melotti commented 3 years ago

Currently we install npm through apt-get in https://github.com/overthesun/simoc-web/blob/bb3b4e6dd20234e59b04c4233e1eab965e711730/Dockerfile#L5-L12

This gives us npm version 7.5.2. Currently version npm@7.24.0 is available, and can be installed with npm install -g npm@7.24.0 or simply npm install -g npm@7 (this will install the latest 7.*).

This can be done in run.sh.

A few things that need to be figured out:

granawkins commented 3 years ago

Regarding npm:

I guess updating npm doesn't seem necessary? I feel like it will be ok as long as we keep Ubuntu up-to-date.

granawkins commented 3 years ago

Regarding @vue-cli, I didn't need to change anything for the installation, so I guess it isn't necessary.

Possibly unrelated but - I was seeing some issues that looked related to vue-cli-service, but it was actually a memory issue. I increased Docker memory allocation from 2GB to 3GB and that fixed the issue.

ezio-melotti commented 3 years ago
* The apt manager gets you the latest version in the Ubuntu appstore by default, not the latest version.
* The simoc-web Dockerfile specifies Ubuntu 21.04, which includes Node 7.5.2

I updated this in 3ee66ab020cc90314e96086171cbc6feb4864c3d a couple of months ago.

* In order to update, you first specify a new nodesource, then run the update command.
  Looks like this would be done in the Dockerfile as part of the command above.

If we do this in the Dockerfile, it will get updated only when we build the image -- which might be good enough.

* In package.json, it appears the best you can do is have it throw an error if not using a specified version of npm.
* Regarding having to install it twice, seems intentional - here is an old thread with an explanation.

FTR I tested this and after running bash -r it picked up the updated npm. If we install the latest version either in the Dockerfile or in run.sh, it shouldn't be a problem since the shell is started aftwerwards.

I guess updating npm doesn't seem necessary? I feel like it will be ok as long as we keep Ubuntu up-to-date.

Agreed, I think we can stick with 7.5.2 for the time being, and keep updating the Ubuntu image.