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

前端 未结 2 1831
执笔经年
执笔经年 2020-12-11 04:05

I\'m new to Node and created an app that has some async/await syntax in it like so:

const express = require(\'express\');
const app = express();

const someL         


        
2条回答
  •  抹茶落季
    2020-12-11 04:34

    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"
      },
      ...
    }
    

提交回复
热议问题