mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:08:09 +08:00 
			
		
		
		
	fix(server): improve tolerance for node version
This commit is contained in:
		
							parent
							
								
									0d62493b77
								
							
						
					
					
						commit
						ddc6ac4590
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		
							
								
								
									
										10
									
								
								src/www.ts
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								src/www.ts
									
										
									
									
									
								
							|  | @ -13,7 +13,7 @@ import utils from "./services/utils.js"; | |||
| import port from "./services/port.js"; | ||||
| import host from "./services/host.js"; | ||||
| 
 | ||||
| const MINIMUM_NODE_VERSION = "22.0.0"; | ||||
| const MINIMUM_NODE_VERSION = "20.0.0"; | ||||
| 
 | ||||
| // setup basic error handling even before requiring dependencies, since those can produce errors as well
 | ||||
| 
 | ||||
|  | @ -33,8 +33,12 @@ function exit() { | |||
| process.on("SIGINT", exit); | ||||
| process.on("SIGTERM", exit); | ||||
| 
 | ||||
| if (utils.compareVersions(process.version, MINIMUM_NODE_VERSION) < 0) { | ||||
|     console.error(`\nTrilium requires Node.js ${MINIMUM_NODE_VERSION} and later.\n`); | ||||
| if (utils.compareVersions(process.versions.node, MINIMUM_NODE_VERSION) < 0) { | ||||
|     console.error(); | ||||
|     console.error(`The Trilium server requires Node.js ${MINIMUM_NODE_VERSION} and later in order to start.\n`); | ||||
|     console.error(`\tCurrent version:\t${process.versions.node}`); | ||||
|     console.error(`\tExpected version:\t${MINIMUM_NODE_VERSION}`); | ||||
|     console.error(); | ||||
|     process.exit(1); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue