[DAEMON-268] appcd-util: Add support for Node.js 11

GitHub Issuen/a
Resolution Date2018-12-14T15:49:13.000+0000
Affected Version/sn/a
Fix Version/sAppc Daemon 2.0.0
Componentsappcd-core, appcd-util
ReporterChris Barber
AssigneeChris Barber


In Node.js 11, they've removed timer_wrap which we use in appcd-util to get the Timer prototype and detect active timers. Node.js 11 has also deprecated process.binding() (https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V11.md#notable-changes-3), so we won't be able to get fs_event_wrap to get a ref to the FSEvent prototype. It's probably also a matter of time before process._getActiveHandles() is removed too. A potential solution is to use [async hooks](https://nodejs.org/api/async_hooks.html) (introduced in Node.js 8.1.0). However, since async hooks must be explicitly enabled, we need to API. This ticket proposes a new class HandleWatcher that lives in appcd-util. It would use async hooks as well as process._getActiveHandles() when either are available. This class would be created by the appcd-core Server instance and facilitate the closing of any open handles. The appcd-util function getActiveHandles() will likely need to be deprecated. Note that since the core process runs as Node.js 10.13.0, we have some time to figure this out. Also, Node.js 11 changed setImmediate() and caused tailgate() to not work correctly. Simply need to stop forcing asynchronous execution of the tailgate callback.


  1. Chris Barber 2018-12-01 https://github.com/appcelerator/appc-daemon/pull/347
  2. Chris Barber 2018-12-07 It's also worth noting this is preventing the AMPLIFY CLI from supporting Node.js 11.

JSON Source