Skip to content
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

Is timeoff-management usable with Node v16? #528

Open
saschafoerster opened this issue Sep 6, 2022 · 1 comment
Open

Is timeoff-management usable with Node v16? #528

saschafoerster opened this issue Sep 6, 2022 · 1 comment

Comments

@saschafoerster
Copy link

saschafoerster commented Sep 6, 2022

@vpp I also had issues with Node 16 like #489, but I would to upgrade like soon, so I can use other node apps on the same machine that expect v16. Did you test 16 already? I will send more logs later on, but maybe you already have checked it yourself. :) Thank you!

@CharlemagneLasse
Copy link

CharlemagneLasse commented Jun 5, 2023

No, this software only works correctly with nodejs 13 - so even with 14, the migration of databases fails (but the rest seems to work fine). Yes, nodejs 13 is completely unsupported. And it also needs python2 (for dependencies) - which is also completely unsupported since 2020. And the dependencies which this tool uses have numerous known security vulnerabilities. So it basically a no go to install this thing in any production environment nowadays. Which is rather bad because the actual software does a lot of things right (and simple).

@vpp are there any plans to get the dependency stuff fixed and migrate to any supported nodejs version? At the moment, only nodejs 18 and 20 are actively supported by nodejs upstream. 16 still receives minimal (maintenance) support.
For python, you would need at least support for python3.11 (and everything lower than 3.7 is completely unsupported).

One of the bigger problems I see at the moment is sequelize(-cli). It has a lot of the weird dependencies (holding everything back) but which also changed the API in the most recent versions.

But if you want to migrate a already existing installation to a new nodejs version (to nodejs 18.x) then it is enough to remove package-lock.json and apply following change

diff --git a/package.json b/package.json
index 9f60e39..6462109 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,7 @@
     "sequelize": "^3.19.2",
     "sequelize-cli": "2.5.1",
     "serve-favicon": "^2.1.7",
-    "sqlite3": "^4.0.1",
+    "sqlite3": "^5.1.5",
     "underscore": "^1.8.3",
     "uuid": "^3.3.2",
     "validator": "^3.43.0"
@@ -46,7 +46,7 @@
   "devDependencies": {
     "chai": "^2.2.0",
     "mocha": "^6.2.2",
-    "node-sass": "^4.5.3",
+    "node-sass": "^7.0.3",
     "request-promise": "^4.2.2",
     "selenium-webdriver": "2.53.3"
   },
@@ -59,6 +59,6 @@
     "preinstall": "npx npm-force-resolutions"
   },
   "resolutions": {
-    "graceful-fs": "^4.2.4"
+    "graceful-fs": "4.2.4"
   }
 }

and run:

rm -rf node_modules
npm install

Most of the things will work fine but the npm run-script db-update will fail in the future due to weird dependencies:

> [email protected] db-update
> node node_modules/.bin/sequelize db:migrate --config=config/db.json --models-path=lib/model/db/


Sequelize [Node: 18.13.0, CLI: 2.5.1, ORM: 3.35.1, sqlite3: ^5.1.5]

fs.js:42
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:42:5
    at req_ (/srv/timeoff-management/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/srv/timeoff-management/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/srv/timeoff-management/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants