adelsz / pgtyped

pgTyped - Typesafe SQL in TypeScript
https://pgtyped.dev
MIT License
2.91k stars 94 forks source link

npx could not determine which executable to run #541

Closed karagraysen closed 1 year ago

karagraysen commented 1 year ago

Describe the bug The README and docs suggest using npx to use pgtyped however when running any npx pgtyped ... command the terminal returns the error:

$ npx pgtyped
> npm ERR! could not determine executable to run

Expected behavior

npx pgtyped should know which executable to run.

Test case

N/A.

adelsz commented 1 year ago

You should install pgtyped as per the readme before you are able to run it with npx.

karagraysen commented 1 year ago

@adelsz This goes against the very idea of npx:

NPX is a NPM package runner. It allows developers to execute any Javascript Package available on the NPM registry without even installing it.

While it mentions in the README to install the packages, a warning/call out that npx requires it should be added to the README (or it npx should be configured to install it if it needs it and it's missing).

adelsz commented 1 year ago

@karagraysen I understand that. We should probably replace npx with npm run to avoid confusion. Running pgTyped without installing it doesn't make much sense, since the codebase queries require pgTyped to be installed anyways.