Fix for CLI startup complaining about version not being found.
This commit is contained in:
parent
0cf7d4ab9c
commit
1aad88adc8
|
@ -69,10 +69,10 @@ function findVersion() {
|
|||
try {
|
||||
const packageJsonFile = findFileInAncestors("package.json", process.cwd())
|
||||
const content = readFileSync(packageJsonFile!, "utf-8")
|
||||
const version = JSON.parse(content).version
|
||||
return version
|
||||
return JSON.parse(content).version
|
||||
} catch {
|
||||
throw new Error("Cannot find a valid version in its package.json")
|
||||
// throwing an error here is confusing/causes backend-core to be hard to import
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue