Skip to content
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

Cannot find module 'mkdirp-promise' #22

Closed
Midhilaj opened this issue Mar 11, 2017 · 5 comments
Closed

Cannot find module 'mkdirp-promise' #22

Midhilaj opened this issue Mar 11, 2017 · 5 comments

Comments

@Midhilaj
Copy link

Midhilaj commented Mar 11, 2017

Error: Error parsing triggers: Cannot find module 'mkdirp-promise'
full code
# firebase deploy --only functions

=== Deploying to '0000000'...

i deploying functions
i functions: ensuring necessary APIs are enabled...
i runtimeconfig: ensuring necessary APIs are enabled...
✔ runtimeconfig: all necessary APIs are enabled
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...

Error: Error parsing triggers: Cannot find module 'mkdirp-promise'

Try running "npm install" in your functions directory before deploying.

Having trouble? Try firebase deploy --help

@nicolasgarnier
Copy link
Contributor

Have you tried running "npm install" in the functions directory first? :)

@nicolasgarnier
Copy link
Contributor

PS: I just updated the README with more details at: https://github.com/firebase/functions-samples/tree/master/generate-thumbnail

@Midhilaj
Copy link
Author

Midhilaj commented Mar 12, 2017

root@midhilaj-Notebook-PC:/opt/functions# firebase deploy --only functions
=== Deploying to '000000000-id-00000000001298'...

i deploying functions
i functions: ensuring necessary APIs are enabled...
i runtimeconfig: ensuring necessary APIs are enabled...
✔ runtimeconfig: all necessary APIs are enabled
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (2.05 KB) for uploading
✔ functions: functions folder uploaded successfully
i starting release process (may take several minutes)...
i functions: deleting function addMessage...
i functions: creating function generateThumbnail...
✔ functions[generateThumbnail]: Successful create operation.
✔ functions[addMessage]: Successful delete operation.
✔ functions: all functions deployed successfully!

✔ Deploy complete!

@Midhilaj
Copy link
Author

Midhilaj commented Mar 12, 2017

in some causes thumbnail size is greater than original image

example

@nicolasgarnier
Copy link
Contributor

The function will generate a "thumbnail" that fits inside a 200x200px box with a default compression quality of 85% for JPEGs.
If you upload an image that's already smaller than 200x200px then this will indeed make a larger image (also same problem if you upload a JPEG with compression lower than 85%). This is a sample so feel free to modify so that it fits your own need. For instance you can lower the compression quality by passing something like -quality 70% and make the image smaller by changing the THUMB_MAX_HEIGHT and THUMB_MAX_WIDTH values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants