当我将 Meteor 应用程序部署到 HEROKU 时收到此错误消息,而 HEROKU 构建本身已成功: 应用程序发生错误,无法提供您的页面。如果您是应用程序所有者,请检查您的日志以了解详细信息。
我认为这与项目中的NODE版本不兼容有关。目前该项目显示如下(我在项目文件中手动更改了此设置,以匹配 HEROKU 命令行提示的 NODE 版本。 meteor /local/build/.node_version.txt:v8.3.0
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): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 8.x...
remote: Downloading and installing node 8.9.4...
remote: Using default npm version: 5.6.0
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json + package-lock)
remote:
remote: > bcrypt@1.0.3 install /tmp/build_716b8c55d4775b8c4db0d8c2018f489f/node_modules/bcrypt
remote: > node-pre-gyp install --fallback-to-build
remote:
remote: [bcrypt] Success: "/tmp/build_716b8c55d4775b8c4db0d8c2018f489f/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote
remote: added 195 packages in 5.765s
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: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote: Done: 44.3M
remote: -----> Launching...
remote: Released v3
remote: https://missionary-expediters-app.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/missionary-expediters-app.git
* [new branch] master -> master
➜ Missionary-Expediters-Web-Application git:(master) heroku logs
2018-01-16T03:58:30.407001+00:00 app[api]: Initial release by user angelica@seaworthy.tech
2018-01-16T03:58:30.407001+00:00 app[api]: Release v1 created by user angelica@seaworthy.tech
2018-01-16T03:58:30.641875+00:00 app[api]: Release v2 created by user angelica@seaworthy.tech
2018-01-16T03:58:30.641875+00:00 app[api]: Enable Logplex by user angelica@seaworthy.tech
2018-01-16T03:59:43.000000+00:00 app[api]: Build started by user angelica@seaworthy.tech
2018-01-16T03:59:59.490555+00:00 app[api]: Deploy f900129c by user angelica@seaworthy.tech
2018-01-16T03:59:59.510788+00:00 app[api]: Scaled to web@1:Free by user angelica@seaworthy.tech
2018-01-16T03:59:43.000000+00:00 app[api]: Build succeeded
2018-01-16T04:00:03.035774+00:00 heroku[web.1]: Starting process with command `npm start`
2018-01-16T03:59:59.490555+00:00 app[api]: Release v3 created by user angelica@seaworthy.tech
2018-01-16T04:00:05.155112+00:00 app[web.1]: > Missionary-Expediters-Web-Application@ start /app
2018-01-16T04:00:05.155090+00:00 app[web.1]:
2018-01-16T04:00:05.168004+00:00 app[web.1]: npm ERR! file sh
2018-01-16T04:00:05.155113+00:00 app[web.1]: > meteor run
2018-01-16T04:00:05.155114+00:00 app[web.1]:
2018-01-16T04:00:05.168910+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-16T04:00:05.162754+00:00 app[web.1]: sh: 1: meteor: not found
2018-01-16T04:00:05.171081+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-01-16T04:00:05.171090+00:00 app[web.1]: npm ERR!
2018-01-16T04:00:05.168907+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-01-16T04:00:05.168911+00:00 app[web.1]: npm ERR! syscall spawn
2018-01-16T04:00:05.170446+00:00 app[web.1]: npm ERR! Missionary-Expediters-Web-Application@ start: `meteor run`
2018-01-16T04:00:05.171096+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-01-16T04:00:05.171091+00:00 app[web.1]: npm ERR! Failed at the Missionary-Expediters-Web-Application@ start script.
2018-01-16T04:00:05.176036+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-01-16T04:00:05.175802+00:00 app[web.1]:
2018-01-16T04:00:05.176169+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-01-16T04_00_05_172Z-debug.log
2018-01-16T04:00:05.242382+00:00 heroku[web.1]: State changed from starting to crashed
2018-01-16T04:00:05.244044+00:00 heroku[web.1]: State changed from crashed to starting
2018-01-16T04:00:05.230580+00:00 heroku[web.1]: Process exited with status 1
2018-01-16T04:00:08.424396+00:00 heroku[web.1]: Starting process with command `npm start`
2018-01-16T04:00:10.625159+00:00 heroku[web.1]: State changed from starting to crashed
2018-01-16T04:00:10.612429+00:00 heroku[web.1]: Process exited with status 1
2018-01-16T04:00:10.540497+00:00 app[web.1]:
2018-01-16T04:00:10.540515+00:00 app[web.1]: > Missionary-Expediters-Web-Application@ start /app
2018-01-16T04:00:10.540516+00:00 app[web.1]: > meteor run
2018-01-16T04:00:10.540517+00:00 app[web.1]:
2018-01-16T04:00:10.546730+00:00 app[web.1]: sh: 1: meteor: not found
2018-01-16T04:00:10.552451+00:00 app[web.1]: npm ERR! file sh
2018-01-16T04:00:10.552644+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-01-16T04:00:10.552794+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-16T04:00:10.552930+00:00 app[web.1]: npm ERR! syscall spawn
2018-01-16T04:00:10.554224+00:00 app[web.1]: npm ERR! Missionary-Expediters-Web-Application@ start: `meteor run`
2018-01-16T04:00:10.554544+00:00 app[web.1]: npm ERR!
2018-01-16T04:00:10.554414+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-01-16T04:00:10.554639+00:00 app[web.1]: npm ERR! Failed at the Missionary-Expediters-Web-Application@ start script.
2018-01-16T04:00:10.559460+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-01-16T04:00:10.559334+00:00 app[web.1]:
2018-01-16T04:00:10.554754+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-01-16T04:00:10.559520+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-01-16T04_00_10_556Z-debug.log
关于如何启动和运行应用程序有什么建议吗?它可以在本地主机上运行
最佳答案
这不应该是 Node 版本的问题,因为我知道 Meteor 支持 8.9.3,而 8.9.4 应该不会有太大差异。
如果您阅读上面的转储,您将看到以下几行:
2018-01-16T04:00:05.168910+00:00 app[web.1]: npm ERR! errno ENOENT
2018-01-16T04:00:05.162754+00:00 app[web.1]: sh: 1: meteor: not found
2018-01-16T04:00:05.171081+00:00 app[web.1]: npm ERR! spawn ENOENT
这告诉您未找到命令 meteor
- 也许您没有将meteor 安装到您的heroku 实例中?这里有一个关于如何设置 Heroku 的指南 - 你已经做过类似的事情了吗?
参见第 5 节:
- Set a Meteor buildpack for your Heroku instance
heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git
What is a buildpack? It’s a collection of scripts that prepares your code for execution by the Heroku dyno manager. Heroku’s cedar stack has no default language/framework support, so we use a buildpack to determine/specify what kind of framework we wanted to build on.
What is cedar then? It’s a polyglot environment, which means it has native support for many popular languages and frameworks (e.g. Rails, Node.js, Java, PHP). It also serves as Heroku’s default runtime stack (cedar-14).
关于node.js - 将 Meteor 应用程序部署到 Heroku 时出错 - 如何更改 NODE 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48274067/