-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Error when using the binary (v2.1.0) #1936
Comments
Works for me. Make sure you have a new enough node version. I have v20.12.2.
|
@domoritz i think you should also adapt the package json if you can only use the software with the latest version ts-json-schema-generator/package.json Lines 44 to 46 in 6b6c47e
it also does not work with version 20 |
Oh weird. I didn't test the other versions (but should have). I'll bump the minimum requirement to make it correct. Thanks for trying the different versions! |
v2.0.1...v2.1.0#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519 Unknown file extension "" for ../node_modules/ts-json-schema-generator/bin/ts-json-schema-generator.
Loading extensionless files is not supported inside of "type":"module" package.json contexts.
The package.json file ../node_modules/ts-json-schema-generator/package.json caused this "type":"module" context.
Try changing ../node_modules/ts-json-schema-generator/bin/ts-json-schema-generator to have a file extension.
Note the "bin" field of package.json can point to a file with an extension, for example {"type":"module","bin":{"ts-json-schema-generator":"./bin/ts-json-schema-generator.js"}} means that if ts-json-schema-generator/package.json Lines 8 to 10 in 6b6c47e
so why not link the js file from the dist |
actually npm is only bothered by the missing extension for the binary resource |
https://github.com/vega/ts-json-schema-generator/blob/fbb72f4e4267b428f9135e03a2f0f5bc39a0a6e9/bin/ts-json-schema-generator doesn't have an extension but imports a file with an extension. Are you saying we might fix the issue by adding the extension? |
yes excatly, thats what the error message is saying |
Sweet. 2.1.1 works again. Thanks for digging into the issue. |
hi i have problems with the binary for the last release
Version
https://github.com/vega/ts-json-schema-generator/releases/tag/v2.1.0
Click here for the commands
With version 2.0.1
With version 2.1.0
node:internal/errors:490 ErrorCaptureStackTrace(err); ^ TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /Users/wernerr/.npm/_npx/2fafbd5150af9509/node_modules/ts-json-schema-generator/bin/ts-json-schema-generator. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file /Users/wernerr/.npm/_npx/2fafbd5150af9509/node_modules/ts-json-schema-generator/package.json caused this "type":"module" context. Try changing /Users/wernerr/.npm/_npx/2fafbd5150af9509/node_modules/ts-json-schema-generator/bin/ts-json-schema-generator to have a file extension. Note the "bin" field of package.json can point to a file with an extension, for example {"type":"module","bin":{"ts-json-schema-generator":"./bin/ts-json-schema-generator.js"}} at new NodeError (node:internal/errors:399:5) at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11) at defaultGetFormat (node:internal/modules/esm/get_format:121:38) at defaultLoad (node:internal/modules/esm/load:81:20) at nextLoad (node:internal/modules/esm/loader:163:28) at ESMLoader.load (node:internal/modules/esm/loader:605:26) at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22) at new ModuleJob (node:internal/modules/esm/module_job:64:26) at #createModuleJob (node:internal/modules/esm/loader:480:17) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34) { code: 'ERR_UNKNOWN_FILE_EXTENSION' }
The text was updated successfully, but these errors were encountered: