You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this purpose, the command should be reading path.join(import.meta.dirname, "package.json") rather than package.json in current working directory, because:
If current working directory does not have package.json file, it leads to ENOENT error.
If current working directory has package.json file, the command would display the version number of the downstream package, instead of the version number of ts-json-schema-generator package.
The text was updated successfully, but these errors were encountered:
Since v2.2.0, the CLI command does not work if it's invoked in a directory without a
package.json
file.Snippet to Reproduce
package.json
tsconfig.json
def/waypoint.ts
Error Message
Cause Analysis
The offending line is:
ts-json-schema-generator/ts-json-schema-generator.ts
Line 11 in 0828229
This was introduced in #1964.
It reads the content of
package.json
intopkg
variable, which is then used to display the version number of ts-json-schema-generator package:ts-json-schema-generator/ts-json-schema-generator.ts
Line 54 in 0828229
For this purpose, the command should be reading
path.join(import.meta.dirname, "package.json")
rather thanpackage.json
in current working directory, because:package.json
file, it leads to ENOENT error.package.json
file, the command would display the version number of the downstream package, instead of the version number of ts-json-schema-generator package.The text was updated successfully, but these errors were encountered: