如何使用github将nodejs应用程序部署到heroku

时间:2016-11-22 16:22:36

标签: javascript node.js heroku

我想部署此应用https://github.com/thefailtheory/neofreelance我正在我的http://livecoding.tv频道上进行开发 到heroku但我面临一个错误

应用程序是基本的,它将尝试解决我每天使用的云中的自由职业问题

这是日志:

2016-11-22T16:20:34.454131+00:00 app[web.1]: npm ERR! code ELIFECYCLE

2016-11-22T16:20:34.454297+00:00 app[web.1]: npm ERR! neofreelance@1.0.0 start: `node app.js`

2016-11-22T16:20:34.454450+00:00 app[web.1]: npm ERR! Exit status 1

2016-11-22T16:20:34.454616+00:00 app[web.1]: npm ERR! 

2016-11-22T16:20:34.454772+00:00 app[web.1]: npm ERR! Failed at the neofreelance@1.0.0 start script 'node app.js'.

2016-11-22T16:20:34.454931+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.

2016-11-22T16:20:34.455081+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the neofreelance package,

2016-11-22T16:20:34.455232+00:00 app[web.1]: npm ERR! not with npm itself.

2016-11-22T16:20:34.455378+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:

2016-11-22T16:20:34.455537+00:00 app[web.1]: npm ERR!     node app.js

2016-11-22T16:20:34.455684+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:

2016-11-22T16:20:34.455833+00:00 app[web.1]: npm ERR!     npm bugs neofreelance

2016-11-22T16:20:34.456007+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:

2016-11-22T16:20:34.456156+00:00 app[web.1]: npm ERR!     npm owner ls neofreelance

2016-11-22T16:20:34.456302+00:00 app[web.1]: npm ERR! There is likely additional logging output above.

2016-11-22T16:20:34.459887+00:00 app[web.1]: 

2016-11-22T16:20:34.460174+00:00 app[web.1]: npm ERR! Please include the following file with any support request:

2016-11-22T16:20:34.460356+00:00 app[web.1]: npm ERR!     /app/npm-debug.log

1 个答案:

答案 0 :(得分:1)

这是因为Heroku在严格模式之外使用的Node版本中尚不支持块范围声明(letconst)。

所以有两个选择:

  • 在文件开头添加"use strict";
  • 使用var而非let