在mac os中解析部署错误

时间:2014-10-14 07:01:57

标签: macos python-2.7 parse-platform

我正在关注here给出的示例代码和说明。我在其中创建了Parse帐户和app

我还使用

安装了Parse MAC OS中的

curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash

现在当我从终端运行parse deploy命令时,我得到以下错误堆栈:

    Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/bin/parse/__main__.py", line 6, in <module>
  File "/usr/local/bin/parse/main.py", line 696, in main
  File "/usr/local/bin/parse/main.py", line 202, in handle_deploy
  File "/usr/local/bin/parse/parse.py", line 110, in __init__
  File "/usr/local/bin/parse/parse.py", line 118, in load_state
  File "/usr/local/bin/parse/config_handler.py", line 125, in get_keys_for_app
  File "/usr/local/bin/parse/config_handler.py", line 100, in get_info_for_apps
  File "/usr/local/bin/parse/config_handler.py", line 112, in get_app_info_for_file
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 3 column 9 (char 32)

我哪里出错了?我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

完成项目设置后:

enter image description here

确保您的global.json文件配置良好。例如:

{
    "applications": {
        "YOUR_APP_NAME": {
            "applicationId": "YOUR_APP_ID", 
            "masterKey": "YOUR_MASTER_KEY"
        }, 
        "ANOTHER_APP_NAME": {
            "applicationId": "ANOTHER_APP_ID", 
            "masterKey": "ANOTHER_MASTER_KEY"
        }, 
        "_default": {
            "link": "YOUR_APP_NAME"
        }
    }, 
    "global": {
        "parseVersion": "1.2.18"
    }
}

所以从终端进入同一级别的文件夹&#34;云&#34;,&#34; config&#34;,&#34;公共&#34;,&#34;测试&#34 ; 并运行命令&#34;解析部署&#34;这将调用默认应用的部署&#34; YOUR_APP_NAME&#34; (将其更改为&#34; ANOTHER_APP_NAME&#34;如果您有其他应用程序发送该云代码,例如开发应用和制作应用)。

确保拥有&#34; main.js &#34;文件在&#34; &#34;文件夹以及&#34; 公开&#34;中的示例 index.html 文件文件夹

如果您正确安装了解析,您应该可以使用它。

希望有所帮助