You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
One of my colleagues is seeing this when trying to install avn today on nodejs 4.2.6:
/Users/john/.avn/node_modules/bluebird/js/main/promise.js:677
throw e;
^
TypeError: fs.readFile(...).catch(...).then(...).reduce is not a function
at Object.exports._all (/Users/john/.avn/lib/plugins.js:56:4)
at Object.all (/Users/john/.avn/lib/plugins.js:21:38)
at Object.exports.first (/Users/john/.avn/lib/plugins.js:84:33)
at match (/Users/john/.avn/lib/hooks.js:29:18)
at Object.<anonymous> (/Users/john/.avn/lib/hooks.js:76:29)
at Object.tryCatcher (/Users/john/.avn/node_modules/bluebird/js/main/util.js:26:23)
at Promise._settlePromiseFromHandler (/Users/john/.avn/node_modules/bluebird/js/main/promise.js:507:31)
at Promise._settlePromiseAt (/Users/john/.avn/node_modules/bluebird/js/main/promise.js:581:18)
at Promise._settlePromises (/Users/john/.avn/node_modules/bluebird/js/main/promise.js:697:14)
at Async._drainQueue (/Users/john/.avn/node_modules/bluebird/js/main/async.js:123:16)
at Async._drainQueues (/Users/john/.avn/node_modules/bluebird/js/main/async.js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/john/.avn/node_modules/bluebird/js/main/async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
When tracing through this, it seems like the promise returned from fs.readFile (via the mz module) is actually a native ES6 Promise instead of a bluebird Promise. But since avn relies on the reduce() method, which is not part of the ES6 Promise spec, it should probably force mz to use bluebird as its Promise implementation. Per https://www.npmjs.com/package/mz , the way to do this seems to be:
require('any-promise/register')('bluebird');
This may also need an update to mz 2.3.1
The text was updated successfully, but these errors were encountered:
One of my colleagues is seeing this when trying to install avn today on nodejs 4.2.6:
When tracing through this, it seems like the promise returned from fs.readFile (via the mz module) is actually a native ES6 Promise instead of a bluebird Promise. But since avn relies on the reduce() method, which is not part of the ES6 Promise spec, it should probably force mz to use bluebird as its Promise implementation. Per https://www.npmjs.com/package/mz , the way to do this seems to be:
This may also need an update to mz 2.3.1
The text was updated successfully, but these errors were encountered: