FroggyPanda / better-supabase-types

70 stars 12 forks source link

better-supabase-types: command not found #7

Closed TimurKr closed 1 year ago

TimurKr commented 1 year ago

Ever since v1.1.0, I get an error better-supabase-types: command not found.

I am running this exact command:

npx better-supabase-types -i lib/database.types.ts -o lib/database.types.ts

If I have installed v1.0.0 it works, but when I update to v1.1.0 or v2.0.0 it doesn't. I also tried the -f tag, but the error is related to the command itself not being found. I also tried downloading it only as a devDependency, but no change.

Was therre any change in the way it should be called?

FroggyPanda commented 1 year ago

That is really weird. It works when I build it locally and everything. Im not familiar with NPM packages so if anyone knows any trouble shooting problems it would be a great help!

FroggyPanda commented 1 year ago

@TimurKr can I assume it works for you when you download the project locally and run it from the dist folder when its built?

barrymichaeldoyle commented 1 year ago

I'm not sure on this one, the changes we made going ahead of v1 shouldn't have caused those errors.

huntabyte commented 1 year ago

I'm also having these issues with pnpm.

Failed to create bin at //.bin/better-supabase-types. The source file at //node_modules/better-supabase-types/dist/index does not exist.

FroggyPanda commented 1 year ago

I might have messed up a little bit. I just did npm unpublish better-supabase-types@2.0.0 and then tried to do npm publish better-supabase-types but got the error of:

npm notice 
npm notice 📦  better-supabase-types@2.0.0
npm notice === Tarball Contents ===
npm notice 403B  .github/workflows/main.yml
npm notice 269B  .prettierrc
npm notice 2.7kB README.md
npm notice 1.3kB dist/generate.js
npm notice 1.6kB dist/index.js
npm notice 1.4kB dist/utils/getTablesProperties.js
npm notice 916B  dist/utils/index.js
npm notice 503B  dist/utils/prettierFormat.js
npm notice 301B  dist/utils/toPascalCase.js
npm notice 922B  package.json
npm notice 977B  src/generate.ts
npm notice 1.5kB src/index.ts
npm notice 1.2kB src/utils/getTablesProperties.ts
npm notice 108B  src/utils/index.ts
npm notice 369B  src/utils/prettierFormat.ts
npm notice 165B  src/utils/toPascalCase.ts
npm notice 302B  tsconfig.json
npm notice === Tarball Details ===
npm notice name:          better-supabase-types
npm notice version:       2.0.0
npm notice filename:      better-supabase-types-2.0.0.tgz
npm notice package size:  4.8 kB
npm notice unpacked size: 14.9 kB
npm notice shasum:        434ee74d462e431ecbdd76e7870e4eca4b582997
npm notice integrity:     sha512-WuBEluXRYhvna[...]dp9ljWCQVXamw==
npm notice total files:   17
npm notice
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access
npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://registry.npmjs.org/better-supabase-types - Cannot publish over previously published version "2.0.0".

What do you guys think the best course of action would be at this point?

Edit: So it looks like I have to wait 24 hours... 🤞hope it will let me publish 2.0.0 again lol

TimurKr commented 1 year ago

@TimurKr can I assume it works for you when you download the project locally and run it from the dist folder when its built?

Yes, that works without an issue. I see you have added the .js extension back to the bin, which I hope will solve the issue.

I don't have much experience with npm packages, but from what I read, bugs like this are usually fixed by releasing a new patch, in this case bumping up the version to 2.0.1 will allow you to publish it immediately and also if anyone already has ^2.0.0 in the dependencies won't be getting errors that the package doesn't exist. Might be worth trying, that way we don't have to wait another 20 hours.

FroggyPanda commented 1 year ago

Actually didn't think about bumping the version to 2.0.1 for some reason lol. But adding .js did fix it!

Thank you all for bearing with me on this tho 🙏 and I really appreciate the contribution that everyone has put into this.

Im also going to keep this up for the next day if anyone else has an issue running it.