Upgrade Node and Npm version for edxapp#6716
Conversation
9b2ff5e to
77cecc5
Compare
|
|
||
| - name: install node dependencies | ||
| shell: "easy_install --version && npm ci" | ||
| shell: "easy_install --version && npm install --no-optional" |
There was a problem hiding this comment.
fsevents is an optional dependency in the edx-platform and that has been a pain point for us for a while and has hindered the node16 upgrade process. I tried fixing all the dependency conflicts in platform and regenerating the package-lock file but still we faced the fsevents error. Skipping optional dependencies looks like a potential fix for us here but npm ci doesn't allow --no-optional flag with it so we had to change that to npm install to use the --no-optional flag with it
There was a problem hiding this comment.
Hmm... I'm not sure I understand. Optional dependencies aren't the same as peer dependencies, and I don't see fsevents listed as an optional dependency. I don't think we actually make use of optionalDependencies in edx-platform's package.json. I'm not sure this will do what we're hoping it will.
I thought we were looking at using legacy-peer-deps? Did we decide that was a bad idea?
There was a problem hiding this comment.
optionalDependencies are listed in package-lock file and fsevents is mentioned as optional dependency there. Also using this command resolved the issue with sandbox build failure. Here is the link to successful sandbox creation with configuration changes from this PR. Also using legacy-peer-deps didn't seem fine to me as it will generate an invalid dependency graph and others will also have to use that flag to keep the behavior consistent as mentioned in this discussion too
There was a problem hiding this comment.
Does this solution require everyone who does an npm install to know to use the --no-optional flag? I'm not sure I understand the implications for local development, as part of a prod build, in devstack or tutor, CI/CD pipelines, etc. I haven't really used the --no-optional flag before so I'm not sure exactly what it's doing. 🤔
There was a problem hiding this comment.
No this issue of fsevents doesn't arise locally. This is only happening for most people in edx on pipelines and I faced this issue while building a sandbox with node16 config even though I had installed dependencies locally with node16 and I didn't get this issue.
There was a problem hiding this comment.
Okay so related to your previous comment I have tried one more thing to remove --no-optional flag and try with just npm install. I was able to build a sandbox with this configuration. The reason for this according to me is that npm ci tries to install packages from package-lock file and there we have fsevents as optional dependency whereas npm install uses the package.json file to install the dependencies and as fsevents is not listed there it succeeds in installing dependencies. According to my theory it also doesn't try to install fsevents because:
fseventsis a macOS package and also an optional dependency- We are on
debianos there and notdarvinin contrast to our local setup where we are using MacOS
Previusly fsevents was being listed and installed as we are generating pacakage-lock file from MacOS and then using that package-lock file using npm ci to install dependencies
0d20ce4 to
8ec2afc
Compare
4282cab to
999b929
Compare
|
I have made some changes to this PR. I have added some environment variables for custom |
|
These changes sound reasonable to me, though admittedly this is the first time I'm seeing many of these files here in Do these changes only effect edX.org? Or would it make sense to have the Build-Test-Release working group review as well? If these files are used by the community/Tutor, I'd recommend having them take a look. |
These changes don't only effect edx.org. Anyone using the master branch will get these changes. You can have it reviewed by Build-Test-Release. However I doubt that this configuration repo is used by Tutor in any way. |
|
If we generate |
|
@jmbowman We tried to do that by on a ubuntu machine but that didn't work because |
|
To be clear, the option where we delete the package-lock.json file and resolve the peer dependency issues is the "right" solution here. Everything else is just trying to find ways of avoiding the issue because of scope, and should be considered a short term workaround. Eventually we need to do this "right". |
|
@aht007 Try this exact steps:
I would have openen a PR to apply those changes but I guess it would miss with your current PR openedx/openedx-platform#30274, so better if you just apply on top of it, (assuming its gonna work and folks here think its better alternative than |
@ghassanmas
|
|
Firstly: you might be able in the final step to use npm 16/8, I didn't meant to say you have to use npm 6 with node /16 in the last step Secondly: Regarding the workflow, let's imagine fsevents issue doesn't exist, how would or were you able to migrate to pacakge-lock v2/node16/npm 8 without having to deal with the peer depedency issue you mentioned? if you are able to do that if fsevents doesn't exists, then I suppose it shall be possible to do by forcing fsevets to be optional. |
|
@ghassanmas |
|
@aht007... you might be right about not having to add fsevents in package.json... I am not sure... however I am certian that node/npm had some bugs regarding --no-optional as what it seems when doing research online... so can you please try to upgrade your node 12/npm 6 to minor version, e.g. node 12.22 / npm 6.14... and then try again to see if you would get it to work... |
|
@ghassanmas |
When I was first tackling this issue, as I remember running On using
|
@ghassanmas |
|
@aht007 can you try with this openedx/openedx-platform/pull/30379 just make sure to use |
|
@ghassanmas Below is the output for this sandbox where it failed again with the same error. You can have a look at the logs and if you have acces then you can also see the sandbox here https://tools-edx-jenkins.edx.org/job/sandboxes/job/CreateSandbox/46659/ |
|
What is the node/npm version this ran on? |
|
|
Okay I think I forgot to include my latest local changes, I just pushed again, will it rerun? |
|
Also there is this issue with this approach that if we even succeed in building a sandbox(which has not been the case till now) by forcing the |
|
Something I can't understand, why is it trying to install it, I wonder if its the npm version that pipeline is using... can we know the exact version of npm/node that is being used. (I am just curious)... |
|
@ghassanmas So we have consensus here that right now we are going to move forward with the upgrade with our old |
|
From my end it seems fine, |
c67876b to
7d777b9
Compare
7d777b9 to
2815911
Compare
2815911 to
67c3785
Compare
* feat: add edxapp npm pin and upgrade Node Co-authored-by: Saad Ali <saad.ali@arbisoft.com>





Desc
This PR updates the Node and npm version for edxapp pipeline to 16 and 8.5.x respectively
Changes have been tested with sandbox
Related PR for adding Node16 support in edx-platform has already been merged.