Skip to content

Commit

Permalink
fix: Use the correct package.json file for node version
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Dec 12, 2023
1 parent d92d2d6 commit 11abb05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/helpers/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ async function packageVersion() {
if (packageVersionCached) return packageVersionCached;

try {
const pkg = await fs.readFile('./package.json', 'utf8');
const pkg = await fs.readFile(
`${RED.settings.nodesDir}/node-red-contrib-home-assistant-websocket/package.json`,
'utf8'
);
packageVersionCached = JSON.parse(pkg).version;
} catch {
packageVersionCached = 'unknown';
Expand Down

0 comments on commit 11abb05

Please sign in to comment.