protobuf.js
protobuf.js copied to clipboard
npm exec `could not determine executable to run`
protobuf.js version: 7.3.0 npm version 10.8.1
When attempting to run via npm exec, I'm getting an error message:
> npx protobufjs
npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\dan\AppData\Local\npm-cache\_logs\2024-06-06T17_02_43_836Z-debug-0.log
> npx protobufjs-cli
npm error could not determine executable to run
npm error A complete log of this run can be found in: C:\Users\dan\AppData\Local\npm-cache\_logs\2024-06-06T17_02_46_306Z-debug-0.log
The mentioned error logs are attached.
I expect one the second one (or preferably both) to launch the pbjs command line program.
Both commands fail to find the "primary" binary of the package defined by getBinFromManifest.
- In
protobufjs, this is because there is no 'bin' entrypoint. - In
protobufjs-cli, this is because there are two bin entries (pbjs,pbts) and neither matches the package name.
To use the cli with npx today, one clumsy workaround is:
> npm exec --package=protobufjs-cli pbjs
2024-06-06T17_02_43_836Z-debug-0.log 2024-06-06T17_02_46_306Z-debug-0.log