将Meteor应用程序部署到Heroku时出错 - 如何更改NODE版本

时间:2018-01-16 04:23:02

标签: node.js meteor heroku

我在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

有关如何启动和运行应用程序的任何建议?它适用于localhost

1 个答案:

答案 0 :(得分:0)

它不应该是节点版本的问题,因为我知道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的指南 - 你有没有做过类似的事情?

https://medium.com/@leonardykris/how-to-run-a-meteor-js-application-on-heroku-in-10-steps-7aceb12de234

见第5节:

  
      
  1. 为Heroku实例设置Meteor buildpack
  2.   

heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git

  

什么是buildpack?这是一系列准备你的脚本   由Heroku dyno经理执行的代码。 Heroku的雪松堆栈   没有默认的语言/框架支持,所以我们使用buildpack来   确定/指定我们想要构建的框架类型。

     

那么雪松是什么?这是一个多语言环境,这意味着它具有   对许多流行语言和框架的原生支持(例如Rails,   Node.js,Java,PHP)。它还充当Heroku的默认运行时堆栈   (雪松-14)。

相关问题