jjangga0214 / hasura-cli

Hasura CLI as an npm package
https://www.npmjs.com/package/hasura-cli
90 stars 27 forks source link

docs: fix npx example #100

Closed revolunet closed 1 year ago

revolunet commented 1 year ago

Hi, looks like we need npx hasura-cli

before :

Capture d’écran 2022-12-26 à 14 09 50

after:

Capture d’écran 2022-12-26 à 14 10 54

PS: thanks a ton for this handy tool !

commit-lint[bot] commented 1 year ago

Documentation

Contributors

revolunet

Commit-Lint commands
You can trigger Commit-Lint actions by commenting on this PR: - `@Commit-Lint merge patch` will merge dependabot PR on "patch" versions (X.X.Y - Y change) - `@Commit-Lint merge minor` will merge dependabot PR on "minor" versions (X.Y.Y - Y change) - `@Commit-Lint merge major` will merge dependabot PR on "major" versions (Y.Y.Y - Y change) - `@Commit-Lint merge disable` will desactivate merge dependabot PR - `@Commit-Lint review` will approve dependabot PR - `@Commit-Lint stop review` will stop approve dependabot PR
jjangga0214 commented 1 year ago

Thank you for the report! Well, the majority of people are OK with hasura. Actually, for them, hasura-cli would cause an error. I believe you're in a specific, rare situation. Would you please share your environment? For example, OS, CLI version, nodejs version, npm/yarn/pnpm version, whether you use IDE-integrated terminal (e.g. vscode's), whether you use WSL, etc.

revolunet commented 1 year ago

Hello, using npm@16 on OSX

when you call npx hasura it try to fetch the npm package named hasura which is another beast and an empy package

jjangga0214 commented 1 year ago

@revolunet Ah, now I think I understand why.

You should execute npx hasura AFTER the installation. For example,

npm install --save-dev hasura-cli
npx hasura version # <== AFTER the installation

If you execute npx hasura BEFORE the installation, then the npx tries to install the package hasura (which is the other one) and execute it. This is why it DOES NOT work.

And, if you execute npx hasura-cli BEFORE the installation, then the npx tries to install the package hasura-cli (which is the right one) and execute it. This is why it DOES work.

I intentionally set the entrypoint name hasura, not hasura-cli, though the package name is hasura-cli. That's because the original binary's entrypoint name is also hasura. I want people to experience consistency.

Thanks for the report anyway. I'd like to close this right now. But if you still have an issue or question, feel free to reopen anytime.

Thanks :)

revolunet commented 1 year ago

as npx hasura-cli always work i think its less confusing to document this way.

Your call by the way, thanks for this package !