Skip to content

Commit 4cbf969

Browse files
Fix require of package.json for global installs
1 parent cc7b5bc commit 4cbf969

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/lib/cli.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const program = require('commander')
22
const loadInit = require('./init')
33
const loadStart = require('./start')
44
const { spawnSync } = require('child_process')
5+
const path = require('path')
56

67
module.exports = function startCli (server) {
78
program.version(getVersion())
@@ -21,7 +22,7 @@ function getVersion () {
2122
return stdout.trim()
2223
} catch (e) {
2324
// Obtain version from package.json
24-
const { version } = require('../package.json')
25+
const { version } = require(path.join(__dirname, '../../package.json'))
2526
return version
2627
}
2728
}

0 commit comments

Comments
 (0)