Skip to content

Build your personal knowledge base with Trilium Notes

fix version detection without running npm

zadamdf4cf80be4d8
diff --git a/src/routes/index.js b/src/routes/index.js
index 37ba9fb46e..6a1abe66a4 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -9,6 +9,7 @@ const log = require('../services/log');
const env = require('../services/env');
const utils = require('../services/utils');
const protectedSessionService = require("../services/protected_session");
+const packageJson = require('../../package.json');
function index(req, res) {
const options = optionService.getOptionsMap();
@@ -37,7 +38,7 @@ function index(req, res) {
extraHoistedNoteId: req.query.extraHoistedNoteId,
isProtectedSessionAvailable: protectedSessionService.isProtectedSessionAvailable(),
maxContentWidth: parseInt(options.maxContentWidth),
- triliumVersion: process.env.npm_package_version
+ triliumVersion: packageJson.version
});
}