Updating Library Requirements
Regarding #1170 , GRNsight now requires an update to its Library Requirements documentation to reflect the latest dependency versions and ensure compatibility with the current development environment.
Updated Library Requirements and now waiting for review.
Packages that were not used in >7 years were deleted. Then specific versions of packages are listed on the wiki referenced above. The packages were updated in the issue for test coverage #1148 were listed as well. Everything is working on @akaiap's machine. The next step is for someone else to try this configuration and make sure that it works for other people. Then we need to make sure that it works on the server. Node 12 is running on the server, so we need to make sure that it will work there. Need to double-check with @dondi.
Plan A: Need to know the minimum version of node that each package needs. They need to be compatible with Node 12. List the minimum version of node next to package on wiki. If it is higher than 12, then back up to find a lower version that is compatible.
If above doesn't work (plan B), @dondi can see how far ahead he can move the operating system (Ubuntu) on the server, then the minimum version of node may be able to go higher. Fair amount of work and will take server down temporarily. The version of node relates to the version of JavaScript we can support. Security patches are also involved. Plan C is to wait to until we no longer depend on node on the backend. This will happen when we shift to lambda, an AWS service which gives a virtual host that typically uses a more recent version of node. There is something incompatible between lambda and how pug generates CSS. We would use lambda when moving to React.
Steps Taken
- Deleted node_modules
- Cleared out new dependencies to start fresh.
1. Tried Node 12
- Failed due to modern JS features (private class fields #fillNegs() and optional chaining ?.) not supported in Node 12.
- Node 12 is also EOL (End of Life), so dependencies often no longer support it.
2. Tried Node 14
- Hard to install on Apple Silicon (no official ARM builds).
- Even if installed, many packages in GRNsight require Node 16 or higher.
- Ultimately abandoned due to repeated build issues.
3. Finally installed Node 16
- Fixed the test import for grnState, which resolved the 2 failing tests.
- When it came to linting in Node 16, I ran into errors because ESLint 9.x requires Node 18+
- GRNsight now runs and tests pass under Node 16.
SO INSTEAD..
- Downgraded eslint to 8.56
- Created another eslint config that is compatible (The structuredClone function (which is causing the error) is only available in Node 18+, so downgrading to ESLint 8.x avoids that requirement.)
- Updated the script in package.json
Node 16 Compatibility for GRNsight Packages
**### Node 16 Compatibility for GRNsight Packages
| Package | Current Version | Min Node Version | Node 16 Compatible Version |
|---|---|---|---|
| eslint | 9.19.0 | Node 18+ | eslint 8.x (still works) |
| express | 4.21.2 | Node 14+ | express 4.17.x |
| mocha | 11.1.0 | Node 18+ | mocha 9.x |
| webpack | 5.97.1 | Node 14+ | webpack 5.72.x |
| nyc | 17.1.0 | Node 16+ | nyc 15.x |
| @babel/core | 7.26.7 | Node 14+ | @babel/core 7.18.x |
| pug | 3.0.3 | Node 10+ | Same (compatible) |
Regarding Plan B, updating the Ubuntu server OS would be necessary to support at least Node 16, which is the new minimum requirement.
Given these findings, @dondi looked up the latest stable version of Ubuntu, which is 24.10, and it appears that this version can go to Node v20.x.x:
https://askubuntu.com/questions/1543474/install-latest-version-of-node-js-on-ubuntu-24-10
@dondi will attempt an OS and nodejs upgrade and will report back
@dondi followed the steps on this page for performing the upgrade: https://repost.aws/knowledge-center/ec2-linux-upgrade-ubuntu-lts
After this, the reported Node version is now v18.19.1. The GRNsight servers were started and they appear to be up and running, but deeper testing is probably warranted
An attempt to move to Node v20.x.x has not yet been attempted because it seems like Node 16 would have sufficed and now we are at Node 18. @akaiap does this sound OK? Shall we try deploying this to the server to see what happens?
Yes! That sounds good!
The servers have been running v.18.19.1 since April and things appear to be running OK. We’ll defer further upgrades in order to focus on other things