Javascript 无法在heroku上部署gulp应用程序。但Heroku本地网站仍然有效

Javascript 无法在heroku上部署gulp应用程序。但Heroku本地网站仍然有效,javascript,node.js,heroku,gulp,Javascript,Node.js,Heroku,Gulp,我正试图在Heroku上推出GoogleWebStarter工具包。我执行以下步骤 ➜ 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 | > @ s

我正试图在Heroku上推出GoogleWebStarter工具包。我执行以下步骤

➜  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)
heroku local-web
命令起作用,我在
localhost:5000上看到本地输出

我在Heroku上部署我的应用程序

➜  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
当我点击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! 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
我的代码可在

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

您应该在main package.json中放置一个启动脚本,如下所示:

"scripts": {
    "start": "gulp && node dist/server.js"
    ...
},

我没有测试,但我认为它应该可以工作。

我必须添加一个
Procfile
并对其进行更改。之后,它开始工作


完整的代码库是,URL是

谢谢,我试过了。见提交。但我仍然看到同样的问题
"scripts": {
    "start": "gulp && node dist/server.js"
    ...
},