Package development, pty.js: incompatible native module


I am trying to write a simple terminal package for atom that can be considered a decent example for 1.0 ā€“ e.g. no hardcoded keybinds, no spacepen views, and interoperability through the services API.

Iā€™d also like it to install out-of-box without user intervention :wink: ā€“ and am now struggling to figure out how to trigger apm rebuild of the package to satiate the pty.js requirement. The following error is shown on a fresh installation:

"Failed to require the main module of 'termy' because it requires an incompatible native module. Run "apm rebuild" in the package directory to resolve."

The bug dialog reports pty.js as the offender:

Rebuilding seems to fix.

Is there a way around this error outside user intervention in the bugs dialog or console?

below is the package.json (

  "name": "termy",
  "main": "./lib/termy",
  "version": "0.1.1",
  "description": "spawn a terminal with a relativized cwd below or to the right of the active file",
  "keywords": [
  "repository": "",
  "license": "MIT",
  "engines": {
    "atom": ">=1.0.0 <2.0.0"
  "dependencies": {
    "pty.js": "^0.3.0",
    "term.js": "^0.0.7"

many thanks!

~ Brice