zpnk / stage-ci

Automatic deploy previews for your PRs using zeit.co/now.
https://stage.now.sh
MIT License
131 stars 23 forks source link

/usr/bin/node: bad option: --harmony-async-await #23

Closed paulirish closed 7 years ago

paulirish commented 7 years ago

I tried deploying via https://deploy.now.sh/?repo=https://github.com/zpnk/stage-ci&env=GITHUB_TOKEN&env=GITHUB_WEBHOOK_SECRET and it failed.

Then I am attempting a manual deploy of stage-ci but it hit this wall.


npm install
✓ Using "yarn.lock"
⧗ Installing 15 main dependencies…
✓ Installed 716 modules [31s]
npm start

> stage-ci@1.1.0 start /home/nowuser/src
> node --harmony-async-await ./src/server.js
/usr/bin/node: bad option: --harmony-async-await
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! stage-ci@1.1.0 start: `node --harmony-async-await ./src/server.js`
npm ERR! Exit status 9
npm ERR! 
npm ERR! Failed at the stage-ci@1.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nowuser/.npm/_logs/2017-06-01T04_34_57_121Z-debug.log
zpnk commented 7 years ago

Whoa interesting! So it looks like this is due to the fact the Now uses the latest node version by default.

Node v8.0.0 landed on 5/30 and it looks like it dropped support for the --harmony-async-await flag (since it's enabled by default as of v.7.6.0).

To fix this problem, we should remove the flag and test against Node v8 (should be fine). Then, moving forward we should specify a node version so this doesn't happen again:

// package.json
"engines": {
  "node": "8.0.x"
}

Sorry you ran into this, but thanks for the report!