Functions-samples: Cannot find module 'mkdirp-promise'

Created on 11 Mar 2017  Â·  5Comments  Â·  Source: firebase/functions-samples

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

Most helpful comment

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

All 5 comments

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

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

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!

in some causes thumbnail size is greater than original image

example

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.

Was this page helpful?
0 / 5 - 0 ratings