How to run Node.js app with ES2017 features enabled on Heroku?

流过昼夜 提交于 2019-11-28 12:13:20

Specify the node version you want to use in your package.json: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

So for async/await support you'll want to specify >= 7.6.0

{
  "engines": {
    "node": ">= 7.6.0"
  }
}

From the Heroku documentation here

https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-app-dependencies

it should be declared in your package.json file which engine(s) should be accessible:

{
  "name": "node-js-getting-started",
  "version": "0.2.5",
  ...
  "engines": {
    "node": "5.9.1"
  },
  "dependencies": {
    "ejs": "2.4.1",
    "express": "4.13.3"
  },
  ...
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!