我正在设置NodeJS Heroku应用程序。我只想要一个空的应用程序启动并运行。
我的目录包含package.json和app.js文件。
Heroku应用程序构建没有错误,但后来我在URL(https://nameless-wave-98692.herokuapp.com/)上得到了一个"应用程序错误" -page。
据我所知,日志中的一切看起来都不错:
-----> 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
你看到有什么问题吗?我做错了吗?
答案 0 :(得分:1)
看起来你错过了一个Procfile
https://devcenter.heroku.com/articles/getting-started-with-nodejs#define-a-procfile
答案 1 :(得分:1)