METEOR_SETTINGS不是有效的json错误,将meteor应用程序部署到heroku时出现此错误

8qgya5xd  于 2022-11-13  发布在  其他
关注(0)|答案(2)|浏览(140)

正如标题所说,我在部署我的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
pod7payv

pod7payv1#

此命令存在问题:

heroku config:add METEOR_SETTINGS="$(cat settings.json)"

你看,在Windows上,$(cat settings.json)只意味着文本,但在Mac上/*nix意味着“获取settings.json文件的内容”。
我建议使用git bash cli来运行这个命令。链接到Git for Windows(使用git bash cli):https://git-for-windows.github.io/

6za6bjd0

6za6bjd02#

在Windows中,您可以在notepad++(插件-〉JSON查看器-〉压缩JSON)中压缩setting.json文件,然后通过复制压缩的json内容来运行以下命令,如下所示

SET METEOR_SETTINGS={"configuration":{"images-folder":"","internal-folder":"","demo-mode":false},"sets-of-classes":[{"name":"Cityscapes","objects":[{"label":"VOID","color":"#CFCFCF"},{"label":"Road","color":"#804080","icon":"Road"},{"label":"Sidewalk","........

现在您可以运行常用命令

相关问题