openedx-unsupported / wg-developer-experience

Old issue repository for the former Developer Experience Working Group
4 stars 0 forks source link

Move node_modules outside of edx-platform in Tutor's openedx image #150

Closed kdmccormick closed 1 year ago

kdmccormick commented 1 year ago

Background

This is a sub-task of https://github.com/openedx/wg-developer-experience/issues/146

The problem: NPM packages are installed into the openedx image at /openedx/edx-platform/node_modules. So, when you mount your own edx-platform, you override that node_modules folder. Now, you must re-install node_modules yourself (tutor dev run --mount=edx-platform lms npm install), which takes a long time and is completely redundant with the node_modules that you had to download when you downloaded the openedx image. If you forget to do this, then your edx-platform frontend will be broken.

The solution: Move node_modules somewhere else in the openedx image, such as /openedx/node_modules.

Tasks

Notes

NPM checks first for node_modules in the current working directory, then checks the parent directory, then the grandparent directory, and so on. This is why we are able to locate NPM packages at /openedx/node_modules without totally breaking edx-platform. node_modules that exist in a mounted edx-platform

kdmccormick commented 1 year ago

Blocked by https://github.com/openedx/edx-platform/issues/31798