【发布时间】:2017-05-12 07:43:40
【问题描述】:
我正在设置一个 NodeJS Heroku 应用程序。我只想启动并运行一个空的应用程序。
我的目录包括一个 package.json 和一个 app.js 文件。
Heroku 应用程序构建时没有错误,但我只是在 URL (https://nameless-wave-98692.herokuapp.com/) 上看到“应用程序错误”页面。
据我所知,日志中的一切看起来都不错:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 6.9.2
engines.npm (package.json): unspecified (use default)
Downloading and installing node 6.9.2...
Using default npm version: 3.10.9
-----> Restoring cache
Loading 2 from cacheDirectories (default):
- node_modules
- bower_components (not cached - skipping)
-----> Building dependencies
Installing node modules (package.json)
-----> Caching build
Clearing previous node cache
Saving 2 cacheDirectories (default):
- node_modules
- bower_components (nothing to cache)
-----> Build succeeded!
└── (empty)
! This app may not specify any way to start a node process
https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 13.4M
-----> Launching...
Released v4
https://nameless-wave-98692.herokuapp.com/ deployed to Heroku
你有什么问题吗?我做错了吗?
【问题讨论】:
-
请提供您的 app.js
-
app.js 可以在这里找到:pastebin.com/GhgQfKkJ
标签: javascript node.js heroku deployment