EqualMa / gitpkg

use a sub directory of a github repo as yarn / npm dependency directly
https://gitpkg.vercel.app
315 stars 19 forks source link

502 bad gateway when npm install #16

Closed MrHertal closed 4 years ago

MrHertal commented 4 years ago

Hi, thank you for this very useful project. I was able to make it work perfectly, but now I have an error when running:

npm install 'https://gitpkg.now.sh/MrHertal/amplify-cli?react-admin-amplify&scripts.postinstall=npm%20install%20--ignore-scripts%20%26%26%20npm%20run%20build%20%26%26%20npm%20prune%20--production'

Which gives me:

npm ERR! code E502
npm ERR! 502 Bad Gateway - GET https://gitpkg.now.sh/MrHertal/amplify-cli?react-admin-amplify=&scripts.postinstall=npm%20install%20--ignore-scripts%20%26%26%20npm%20run%20build%20%26%26%20npm%20prune%20--production

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ghertault/.npm/_logs/2020-06-10T10_16_01_143Z-debug.log

I think that what causes the issue is that the repository https://github.com/MrHertal/amplify-cli is a fork that I deleted (for personal reason) then recreated again. Since I did that, it does not work anymore.

Thank you for your help.

MrHertal commented 4 years ago

Sorry I made a dumb mistake,

I forgot to include subfolder in the repo url:

npm install 'https://gitpkg.now.sh/MrHertal/amplify-cli/packages/amplify-graphql-docs-generator?react-admin-amplify&scripts.postinstall=npm%20install%20--ignore-scripts%20%26%26%20npm%20run%20build%20%26%26%20npm%20prune%20--production'

Now it is working.

EqualMa commented 4 years ago

Thanks for pointing this out, I'm glad that you make it work. But the link without subfolder should also work.

As reported in the logs, the error is LAMBDA_RUNTIME Failed to post handler success response. Http response code: 413.

I searched about this error message, and I found this is because of the limitation of aws lambda (vercel now is on it), as talked in this issue. The invocation payload maximum limit is 6MB. Thus, if the repo is very large, the file size exceeds 6MB, then the request will fail.

I don't know how to overcome this limitation, ideas are welcome~