正如标题所说,我在部署我的meteor应用程序到heroku时遇到了这个错误。我已经用JSONlint验证了我的settings.json文件,并搜索了任何可能的修复程序,但我没有遇到任何有效的修复程序。我的错误日志如下所示。有人能告诉我可能出了什么问题吗?
2017-09-03T11:18:31.226632+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node $NODEJS_PARAMS .meteor/heroku_build/app/main.js`
2017-09-03T11:18:33.344368+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/boot.js:391
2017-09-03T11:18:33.344382+00:00 app[web.1]: }).run();
2017-09-03T11:18:33.344383+00:00 app[web.1]: ^
2017-09-03T11:18:33.344384+00:00 app[web.1]:
2017-09-03T11:18:33.344385+00:00 app[web.1]: Error: METEOR_SETTINGS are not valid JSON: $(cat settings.json)
2017-09-03T11:18:33.344385+00:00 app[web.1]: at packages/meteor.js:59:11
2017-09-03T11:18:33.344386+00:00 app[web.1]: at packages/meteor.js:80:4
2017-09-03T11:18:33.344387+00:00 app[web.1]: at packages/meteor.js:1380:3
2017-09-03T11:18:33.344388+00:00 app[web.1]: at /app/.meteor/heroku_build/app/programs/server/boot.js:338:34
2017-09-03T11:18:33.344388+00:00 app[web.1]: at Array.forEach (native)
2017-09-03T11:18:33.344389+00:00 app[web.1]: at Function._.each._.forEach (/app/.meteor/heroku_build/app/programs/server/node_modules/underscore/underscore.js:79:11)
2017-09-03T11:18:33.344390+00:00 app[web.1]: at /app/.meteor/heroku_build/app/programs/server/boot.js:158:5
2017-09-03T11:18:33.344391+00:00 app[web.1]: at /app/.meteor/heroku_build/app/programs/server/boot.js:387:5
2017-09-03T11:18:33.344392+00:00 app[web.1]: at Function.run (/app/.meteor/heroku_build/app/programs/server/profile.js:510:12)
2017-09-03T11:18:33.344392+00:00 app[web.1]: at /app/.meteor/heroku_build/app/programs/server/boot.js:386:11
2017-09-03T11:18:33.415049+00:00 heroku[web.1]: State changed from starting to crashed
2017-09-03T11:18:33.400865+00:00 heroku[web.1]: Process exited with status 1
2条答案
按热度按时间pod7payv1#
此命令存在问题:
你看,在Windows上,
$(cat settings.json)
只意味着文本,但在Mac上/*nix意味着“获取settings.json
文件的内容”。我建议使用git bash cli来运行这个命令。链接到Git for Windows(使用git bash cli):https://git-for-windows.github.io/
6za6bjd02#
在Windows中,您可以在notepad++(插件-〉JSON查看器-〉压缩JSON)中压缩setting.json文件,然后通过复制压缩的json内容来运行以下命令,如下所示
现在您可以运行常用命令