Skip to content

Error: the target of promisifyAll must be an object or a function

benjamingr edited this page Feb 6, 2014 · 1 revision

Error: the target of promisifyAll must be an object or a function

This can happen when you are calling .promisifyAll on a function and invoking it instead of passing it.

In general, the usage of .promisifyAll is along the lines of var fs = Promise.promisifyAll(require("fs")).

Consider reading the section about promisification in the API