无法在heroku上部署gulp应用程序。 Heroku本地网络虽然工作 [英] Can not deploy gulp application on heroku. Heroku local web works though

查看:269
本文介绍了无法在heroku上部署gulp应用程序。 Heroku本地网络虽然工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Heroku上推送谷歌网络入门套件。我执行以下步骤:

 ➜dist git:(deploy_heroku)heroku local web 
[WARN]找不到ENV文件
[WARN] ENOENT:没有这样的文件或目录,打开'Procfile'
[OKAY]找到package.json文件 - 尝试'npm start'
5:53:43 PM web.1 | > @ start /Users/Harit.Himanshu/Downloads/web-starter-kit/dist
5:53:43 PM web.1 | >节点server.js
5:53:43 PM web.1 |服务器正在运行...
^ C [WARN]用户中断
[DONE]使用信号SIGINT
杀死所有进程5:53:50 PM web.1退出并退出代码null
➜dist git:(deploy_heroku)heroku创建
创建应用...完成,⬢沸腾 - taiga-42200
https://boiling-taiga-42200.herokuapp.com/ | https://git.heroku.com/boiling-taiga-42200.git
➜dist git:(deploy_heroku)git remote -v
origin git@github.com:hhimanshu / web-starter-kit .git(fetch)
origin git@github.com:hhimanshu / web-starter-kit.git(push)
➜dist git:(deploy_heroku)git remote add heroku https://git.heroku .com / boiling-taiga-42200.git
➜dist git:(deploy_heroku)git remote -v
heroku https://git.heroku.com/boiling-taiga-42200.git(fetch)
heroku https://git.heroku.com/boiling-taiga-42200.git(push)
origin git@github.com:hhimanshu / web-starter-kit.git(fetch)
origin git@github.com:hhimanshu / web-starter-kit.git(push)
➜dist git:(deploy_heroku)


$ b

heroku local web 命令的工作原理我在 localhost:5000 as





我将 Heroku 的应用程序部署为

 ➜dist git:(deploy_heroku)git push heroku master 
计数对象:5044,完成。
使用多达8个线程的增量压缩。
压缩对象:100%(2710/2710),完成。
写作对象:100%(5044/5044),7.34 MiB |完成67.00 KiB / s。
合计5044(德尔塔1938),重用5044(德尔塔1938)
远程:压缩源文件...完成。
remote:建筑来源:
remote:
remote:-----> Node.js应用程序检测到
remote:
remote:----->创建运行时环境
remote:
remote:NPM_CONFIG_LOGLEVEL =错误
remote:NPM_CONFIG_PRODUCTION = true $ b $ remote:NODE_VERBOSE = false
remote:NODE_ENV =生产
remote :NODE_MODULES_CACHE = true
remote:
remote:----->安装二进制文件
remote:engines.node(package.json):> = 0.12
remote:engines.npm(package.json):unspecified(使用默认值)
remote:
remote:通过semver.io ...解析节点版本> = 0.12 ...
remote:下载和安装节点7.7.4 ...
remote:使用默认npm版本:4.1.2
远程:通过semver.io解析纱线版本(最新)...
远程:下载和安装纱线(0.21.3)...
远程:安装的纱线0.21.3
远程:
remote:----->恢复缓存
remote:跳过缓存恢复(新的运行时间签名)
remote:
remote:----->建立依赖关系
remote:安装节点模块(yarn.lock)
remote:yarn install v0.21.3
remote:[1/4]正在解析程序包...
remote:成功没有安装。
remote:在1.05s内完成。
remote:
remote:----->缓存构建
remote:清除以前的节点缓存
remote:保存2个cacheDirectories(默认):
remote: - node_modules
remote: - bower_components(不需要缓存)
远程:
remote:----->建立成功!
remote:!此应用程序可能不指定任何方式来启动节点进程
remote:https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
remote:
remote:----->发现进程类型
remote:Procfile声明类型 - > (无)
remote:buildpack的默认类型 - > web
remote:
remote:----->压缩...
remote:完成:18.3M
remote:----->启动...
remote:已发布v3
remote:已将https://boiling-taiga-42200.herokuapp.com/部署到Heroku
remote:
remote:正在验证部署。 ..完成。
转至https://git.heroku.com/boiling-taiga-42200.git
* [新分行] master - > master

当我点击URL时,它会显示应用程序错误



错误追踪

  2017-03-27T04:56:45.397951 + 00:00 app [web.1]:
2017-03-27T04:56:45.399472 + 00:00 app [web。 1]:npm ERR!缺少脚本:start
2017-03-27T04:56:45.399686 + 00:00 app [web.1]:npm ERR!
2017-03-27T04:56:45.399861 + 00:00 app [web.1]:npm ERR!如果您需要帮助,您可以在以下位置报告此错误:
2017-03-27T04:56:45.400026 + 00:00 app [web.1]:npm ERR! < HTTPS://github.com/npm/npm/issues>
2017-03-27T04:56:45.419350 + 00:00 app [web.1]:
2017-03-27T04:56:45.419614 + 00:00 app [web.1]:npm ERR !请在任何支持请求中包含以下文件:
2017-03-27T04:56:45.419750 + 00:00 app [web.1]:npm ERR! /app/npm-debug.log
2017-03-27T04:56:45.524517 + 00:00 heroku [web.1]:状态从开始变为崩溃
2017-03-27T04:56: 46.462158 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path =/host = boiling-taiga-42200.herokuapp.com request_id = abfa26e5-8d4f-4dbc-8b50 -2eec45508374 fwd =118.149.101.58dyno = connect = service = status = 503 bytes = protocol = https
2017-03-27T04:56:48.496510 + 00:00 heroku [router]:at = error code = H10 desc =App crashedmethod = GET path =/ favicon.icohost = boiling-taiga-42200.herokuapp.com request_id = 51685bf3-ef8d-4579-8390-b1fae8638251 fwd =118.149.101.58dyno = connect = service = status = 503 bytes = protocol = https

另外,当我尝试构建应用程序时Heroku,失败了

$ p $ ➜dist git:(deploy_heroku)heroku run gulp build
运行gulp build on⬢boiling- taiga-42200 ... up,run.2849(免费)
bash:gulp:找不到命令
➜dist git:(deploy_heroku)

我的代码可在 https://github.com/hhimanshu/web-starter-kit/tree/deploy_heroku



有人可以告诉我如何解决这个问题?非常感谢

解决方案

我必须添加一个 Procfile 到它。之后,它开始工作



完整的代码库是 https://github.com/hhimanshu/web-starter-kit 和URL是 https://guarded-island-95163.herokuapp.com/


I am trying to push google web starter kit on Heroku. I perform following steps

➜  dist git:(deploy_heroku) heroku local web
[WARN] No ENV file found
[WARN] ENOENT: no such file or directory, open 'Procfile'
[OKAY] package.json file found - trying 'npm start'
5:53:43 PM web.1 |  > @ start /Users/Harit.Himanshu/Downloads/web-starter-kit/dist
5:53:43 PM web.1 |  > node server.js
5:53:43 PM web.1 |  Server running...
^C[WARN] Interrupted by User
[DONE] Killing all processes with signal  SIGINT
5:53:50 PM web.1 Exited with exit code null
➜  dist git:(deploy_heroku) heroku create
Creating app... done, ⬢ boiling-taiga-42200
https://boiling-taiga-42200.herokuapp.com/ | https://git.heroku.com/boiling-taiga-42200.git
➜  dist git:(deploy_heroku) git remote -v
origin     git@github.com:hhimanshu/web-starter-kit.git (fetch)
origin     git@github.com:hhimanshu/web-starter-kit.git (push)
➜  dist git:(deploy_heroku) git remote add heroku https://git.heroku.com/boiling-taiga-42200.git
➜  dist git:(deploy_heroku) git remote -v
heroku     https://git.heroku.com/boiling-taiga-42200.git (fetch)
heroku     https://git.heroku.com/boiling-taiga-42200.git (push)
origin     git@github.com:hhimanshu/web-starter-kit.git (fetch)
origin     git@github.com:hhimanshu/web-starter-kit.git (push)
➜  dist git:(deploy_heroku)

The heroku local web command works I see the output locally on localhost:5000 as

The I deploy my app on Heroku as

➜  dist git:(deploy_heroku) git push heroku master
Counting objects: 5044, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2710/2710), done.
Writing objects: 100% (5044/5044), 7.34 MiB | 67.00 KiB/s, done.
Total 5044 (delta 1938), reused 5044 (delta 1938)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  >=0.12
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Resolving node version >=0.12 via semver.io...
remote:        Downloading and installing node 7.7.4...
remote:        Using default npm version: 4.1.2
remote:        Resolving yarn version (latest) via semver.io...
remote:        Downloading and installing yarn (0.21.3)...
remote:        Installed yarn 0.21.3
remote:
remote: -----> Restoring cache
remote:        Skipping cache restore (new runtime signature)
remote:
remote: -----> Building dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v0.21.3
remote:        [1/4] Resolving packages...
remote:        success Nothing to install.
remote:        Done in 1.05s.
remote:
remote: -----> Caching build
remote:        Clearing previous node cache
remote:        Saving 2 cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote:  !     This app may not specify any way to start a node process
remote:        https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
remote:
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 18.3M
remote: -----> Launching...
remote:        Released v3
remote:        https://boiling-taiga-42200.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/boiling-taiga-42200.git
* [new branch]      master -> master

and when I hit the URL, it says Application Error.

The error trace is

2017-03-27T04:56:45.397951+00:00 app[web.1]: 
2017-03-27T04:56:45.399472+00:00 app[web.1]: npm ERR! missing script: start
2017-03-27T04:56:45.399686+00:00 app[web.1]: npm ERR! 
2017-03-27T04:56:45.399861+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2017-03-27T04:56:45.400026+00:00 app[web.1]: npm ERR!     <https://github.com/npm/npm/issues>
2017-03-27T04:56:45.419350+00:00 app[web.1]: 
2017-03-27T04:56:45.419614+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-03-27T04:56:45.419750+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-03-27T04:56:45.524517+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-27T04:56:46.462158+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=boiling-taiga-42200.herokuapp.com request_id=abfa26e5-8d4f-4dbc-8b50-2eec45508374 fwd="118.149.101.58" dyno= connect= service= status=503 bytes= protocol=https
2017-03-27T04:56:48.496510+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=boiling-taiga-42200.herokuapp.com request_id=51685bf3-ef8d-4579-8390-b1fae8638251 fwd="118.149.101.58" dyno= connect= service= status=503 bytes= protocol=https

Also, when I try to build the app on Heroku, it failed

➜  dist git:(deploy_heroku) heroku run gulp build
Running gulp build on ⬢ boiling-taiga-42200... up, run.2849 (Free)
bash: gulp: command not found
➜  dist git:(deploy_heroku)

My code is available at https://github.com/hhimanshu/web-starter-kit/tree/deploy_heroku

Can someone please tell me how do I fix this issue? Thanks a lot

解决方案

I had to add a Procfile and add changes to it. After that, it started to work

The complete codebase is https://github.com/hhimanshu/web-starter-kit and the URL is https://guarded-island-95163.herokuapp.com/

这篇关于无法在heroku上部署gulp应用程序。 Heroku本地网络虽然工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆