简体   繁体   English

如何使用github将Node.js应用程序部署到Heroku

[英]How to deploy a nodejs app to heroku with github

i want to deploy this application https://github.com/thefailtheory/neofreelance i am developping on my http://livecoding.tv channel to heroku but i am facing an error 我想将此应用程序部署到https://github.com/thefailtheory/neofreelance我正在http://livecoding.tv频道上开发到heroku,但遇到错误

the application is basic it will try to solve a problem on freelancing in the cloud i use everyday 该应用程序是基本的,它将尝试解决我每天使用的云中的自由职业问题

here is the log : 这是日志:

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

That is because Block-scoped declarations ( let , const ) are not yet supported in the Node version Heroku is using outside of strict mode. 这是因为Heroku在严格模式之外使用的Node版本尚不支持块范围的声明( letconst )。

So two options: 有两个选择:

  • Add "use strict"; 添加"use strict"; at the beginning of your file 在文件的开头
  • Use var and not let . 使用var而不是let

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM