TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /Users/magicdawn/Library/pnpm/global/5/.pnpm/pdf2json@3.0.3/node_modules/pdf2json/bin/pdf2json. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file /Users/magicdawn/Library/pnpm/global/5/.pnpm/pdf2json@3.0.3/node_modules/pdf2json/package.json caused this "type":"module" context. Try changing /Users/magicdawn/Library/pnpm/global/5/.pnpm/pdf2json@3.0.3/node_modules/pdf2json/bin/pdf2json 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":{"pdf2json":"./bin/pdf2json.js"}}
looks like bin/pdf2json has to change to bin/pdf2json.js
when using in cli
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension "" for /Users/magicdawn/Library/pnpm/global/5/.pnpm/pdf2json@3.0.3/node_modules/pdf2json/bin/pdf2json. Loading extensionless files is not supported inside of "type":"module" package.json contexts. The package.json file /Users/magicdawn/Library/pnpm/global/5/.pnpm/pdf2json@3.0.3/node_modules/pdf2json/package.json caused this "type":"module" context. Try changing /Users/magicdawn/Library/pnpm/global/5/.pnpm/pdf2json@3.0.3/node_modules/pdf2json/bin/pdf2json 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":{"pdf2json":"./bin/pdf2json.js"}}
looks like
bin/pdf2json
has to change tobin/pdf2json.js
env
node: latest lts v18.14.1 pkg: latest v3.0.3