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

前端 未结 2 1835
执笔经年
执笔经年 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:22

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

提交回复
热议问题