elierotenberg / fastify-zod

Zod integration with Fastify
MIT License
212 stars 19 forks source link

Unable to install (postbuild and babel not found error message) #19

Closed kayode-adechinan closed 2 years ago

kayode-adechinan commented 2 years ago

Hello, thanks for the hard work you put on this library. I was able to install the previous version, but lately :

When doing the following on a fresh project:

I get some error messages

npm ERR! > fastify-zod@1.0.1 build:babel npm ERR! > babel src --out-dir build --extensions '.ts' --source-maps npm ERR! sh: 1: babel: not found

Gomah commented 2 years ago

Same error here, @elierotenberg, would you be open to use a tool like tsup instead? I also think it should be "prepublishOnly" instead of "postinstall"?

Gomah commented 2 years ago

I adjusted a few things on my fork: https://github.com/Gomah/fastify-zod/commits/master , @elierotenberg happy to open a PR if you're keen?

elierotenberg commented 2 years ago

You are right. postinstall hooks are triggered when the package is installed as a dependency and therefore broke everything.

I've removed the internal test-openapi-client package from devDependencies, as it is built as part as npm run build anyway.

Does that cover your needs?

elierotenberg commented 2 years ago

Also please go ahead with the PR, I'm not familiar with tsup but this is an opportunity to learn!

teddybee commented 2 years ago

1.0.2 has solved the yarn install problem with typescript.

kayode-adechinan commented 2 years ago

BIG THANK GUYS