Closed gitSambhal closed 8 months ago
I got same question. Do you have any solution? @gitSambhal
Hi @gitSambhal I got a solution. And share for you. Try it:
var pjson = require('../../package.json');
console.log(pjson.version);
Hi @huangganggui, Thanks for sharing. I had used somthing similar.
What version of pkg are you using?
5.8.1
What version of Node.js are you using?
v18.16.0
What operating system are you using?
Windows
What CPU architecture are you using?
arm64
What Node versions, OSs and CPU architectures are you building for?
node18-win-x64
Describe the Bug
The following environment variables are not available while running as binary:
Expected Behavior
These environment variables should be present having the respective values from package.json file.
To Reproduce
console.log('process env', process.env);