Skip to content

Node Version? #1690

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

Closed
eightysixed opened this issue Apr 12, 2025 · 14 comments
Closed

Node Version? #1690

eightysixed opened this issue Apr 12, 2025 · 14 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@eightysixed
Copy link

eightysixed commented Apr 12, 2025

I am migrating over to TriliumNext and figured I might as well roll with a manual server install. I wanted to double check the node version, but in the (what seems to be) outdated documentation mentions 14 and 16 only being supported and tested. I was hoping it'd be compatible with at least v20. I don't need anything past thing, I wouldn't think, yet?

Basically, on a brand new server install what version of Node is recommended for TriliumNext, and where should I go put in a PR to make it known? :)

@eightysixed
Copy link
Author

eightysixed commented Apr 12, 2025

Nevermind. Node 22.
Anything game-breaking if I stay on v20?

The Docs are uneditable though :)

@eliandoran
Copy link
Contributor

@eightysixed , indeed, it's Node 22.

That page of documentation could use some love, yes.
If you wish to contribute, it's been relocated in the Notes repo, you can modify it in docs\User Guide\User Guide\Installation & Setup\Server Installation\1. Installing the server\Manually.md.

@eightysixed
Copy link
Author

Okay, will do 👍

Is 22 required or just supported?
I'd rather keep everything on 20 for the moment if possible :)

@pano9000
Copy link
Member

for building the project from source, 22 is definitely required — for running it, I think v20 should work as well.

Give me a minute, I'll do a test build with v20 runtime and confirm back

@eliandoran
Copy link
Contributor

Indeed, at application level we enforce at least Node 20. I believe Electron uses (or at least used at some point) Node 20 so we could not enforce Node 22.

Generally we encourage using the latest LTS versions when possible.

@pano9000
Copy link
Member

interestingly though: for the Server build (using the build-server script locally) → using v20.19.0 produces a crash when trying to run it

pano@elitebook:~/Programming/0_repos/TriliumNextNotes/dist/TriliumNextNotes-Server-0.92.7-linux-x64$ ./node/bin/node -v
v20.19.0
pano@elitebook:~/Programming/0_repos/TriliumNextNotes/dist/TriliumNextNotes-Server-0.92.7-linux-x64$ ./node/bin/node src/main.js


#
# Fatal error in , line 0
# Check failed: module->status() == kLinked || module->status() == kEvaluated.
#
#
#
#FailureMessage Object: 0x7fff50f5ba30
----- Native stack trace -----

 1: 0xd43461  [./node/bin/node]
 2: 0x218e601 V8_Fatal(char const*, ...) [./node/bin/node]
 3: 0x1414892 v8::internal::SourceTextModule::Evaluate(v8::internal::Isolate*, v8::internal::Handle<v8::internal::SourceTextModule>) [./node/bin/node]
 4: 0xf25daa v8::Module::Evaluate(v8::Local<v8::Context>) [./node/bin/node]
 5: 0xc76b6b node::loader::ModuleWrap::Evaluate(v8::FunctionCallbackInfo<v8::Value> const&) [./node/bin/node]
 6: 0xf6c56f v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [./node/bin/node]
 7: 0xf6cddd  [./node/bin/node]
 8: 0xf6d2a5 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [./node/bin/node]
 9: 0x1977df6  [./node/bin/node]
Trace/Breakpoint ausgelöst (Speicherabzug geschrieben)

will need to check this evening, if that is an issue on my side only though

@eliandoran
Copy link
Contributor

@pano9000 , did you rebuild the native dependencies? Try rm -rf node_modules followed by npm install on Node v20.

@eliandoran
Copy link
Contributor

@eightysixed , here's the documentation on how to edit the documentation: https://github.com/TriliumNext/Notes/blob/develop/docs/Developer%20Guide/Developer%20Guide/Documentation.md

Since you are not modifying the structure, it's feasible for you to modify the Markdown document directly. More complex changes require npm run docs:edit.

@eightysixed
Copy link
Author

I'm glad I looked into this, actually. The only reason I was holding back on 22 was because of umami-software/umami. That was bumped to 22 two months ago. Thanks for looking into this regardless!

Thanks for the documentation on the documentation :) I found that earlier. I'll give it a shot on a dev server that's using 20 just to test what I was already asking, but ultimately land on 22 anyway. I'll leave this open for the weekend :)

@eliandoran eliandoran added the documentation Improvements or additions to documentation label Apr 13, 2025
@eightysixed
Copy link
Author

Okay, good news! (And bad, maybe?)

TriliumNext does, indeed, work fine on Node v20! And obviously it works fine on Node v22.

However, some of the warnings from the dependencies are worth a second glance.

npm -v
10.9.2

node -v
v22.14.0

npm install
npm warn skipping integrity check for git dependency ssh://[email protected]/electron/node-gyp.git
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.
npm warn deprecated [email protected]: This package is deprecated. Use the optional chaining (?.) operator instead.
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which i>
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: Please use @electron/asar moving forward.  There is no API change, just a package name change
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported

Same thing on 20, but it works, so that's the neat part. I'm sure I won't be the last person to wonder, so I'll make sure it gets reflected. And then obviously remove it once that's no longer the case.

The two of main concern I think wold be [email protected] due to a memory leak. I would think most users leave TriliumNext open more often that not, although I don't know how often that's called, as I haven't really looked into this too deep yet. And [email protected] being as it's been moved, but again I don't know how often its used.

I've been using TriliumNext for awhile now, but finishing a migration this weekend. Good news is, the original question is answered. Built for 22, works on 20. TriliumNext seems update often, so I'll slowly chip away at some of the docs when I can/where necessary. So the main question I suppose, I answered just by giving it a shot, so now we all know and I'll make sure to update the docs.

What about the memory leak dependency? I understand deprecated packages and warns, but that one may need a second glance, possibly. And the the others, curiously? Does the ML comment warrant its own PR?

Anyway, TriliumNext does work on Node 20. I'll leave this open for advisement/comment on the above.
At least we can say with certainty it does work fine otherwise on 20 :)

@eightysixed
Copy link
Author

eightysixed commented Apr 14, 2025

Just to be clear this is directly from git clone https://github.com/TrilliumNext/Notes.git on both Node 22 & 20.

edit: Nevermind - #624

I'm not sure I've seen a Sticky on Github before. Cheers.

Alright, fair enough. I'll wait until tomorrow to close or an acknowledgment. Thanks!

edit2: https://developer.mend.io//github/TriliumNext/Notes - This seems to be broken, so I guess the dependency question still remains :)

@pano9000
Copy link
Member

most of these warnings come from "transitive dependencies", which are a bit out of our direct control.

I did just push a commit that will get rid of the "asar" warning though :-)

@eliandoran
Copy link
Contributor

@eightysixed ,

edit2: https://developer.mend.io//github/TriliumNext/Notes - This seems to be broken, so I guess the dependency question still remains :)

It's actually not broken, but it requires authentication using GitHub. Not sure if the dashboard is publicly accessible, or only to members of the org.

Either way, the content is the same as the dashborad in #624.

@eightysixed
Copy link
Author

Sounds good!

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

No branches or pull requests

3 participants