-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated package.json is not valid #508
Comments
Hi @TheDutchCoder. I think the package.json is valid with |
BTW surely we can add placeholder name and version to the file as well 👍🏼 |
This probably comes from some form of validator on the AWS side, which (I think) assumes the package is a publishable one. I can't find any docs that say NPM themselves mark name and version as required: https://docs.npmjs.com/creating-a-package-json-file so I think that's what the AWS validator uses as a base. I'm more than willing to PR this, but I couldn't find the root's imported package.json in the code that generates the output package.json. I think it might be a good idea to grab the name and version from the root's file, with backup values in case they're missing? |
Well there is not single standard across package managers. Some only require version... I think it should be fine using stub name and version for the output like |
Yeah that sounds good, do you want me to PR it? |
Sure thanks ❤️ |
Ready! |
Environment
Node: v16.15.1
Nitro: 0.5.3
Reproduction
Probably doesn't need a reproduction, but let me know if I need to supply a Stackblitz or GH repro
Describe the bug
When using the
aws-lamda
preset (probably goes for other ones too), the generated package.json is missing the required fieldsname
andversion
, which means that deploying the code through (for example) SAM fails.Maybe the name and version could be grabbed from the root's package.json?
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: