Appcelerator Studio undefined1 SyntaxError: Unexpected end of input

Appcelerator Studio undefined1 SyntaxError: Unexpected end of input

我的 Appcelerator Studio 突然崩溃,无法打开或使用。我尝试卸载并重新安装它,但没有成功。

对此有什么想法吗?请检查 Crash error report here

系统信息

OS: MAC(OS X El Capitan v10.11.3) 内存:4GB RAM

崩溃报告

undefined:1

SyntaxError: Unexpected end of input
at Object.parse (native)
at Object.readConfig (/usr/local/lib/node_modules/appcelerator/lib/util.js:720:30)
at Object.<anonymous> (/usr/local/lib/node_modules/appcelerator/bin/appc:96:23)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3

看起来你的 CLI 版本和 Node 版本不兼容。

您现在运行正在使用的节点和 CLI 版本是多少?

运行 最新的 Studio 4.8.0/CLI 6.0/SDK 6.0 需要 Node 4.2 及更高版本。理想情况下,Studio Mac 安装程序会处理此问题,但您的情况并未发生。

要使其适用于您的情况,请按照此处的说明全新安装 Node 和 CLI,然后 运行 工作室。

https://medium.com/all-titanium/reinstalling-appcelerator-titanium-on-mac-from-scratch-9a2bb6b9b629#.d0k1wzt3z

我在 Appc 7.1.2 中遇到了类似的错误 -- 这是我了解到的。

具体错误发生在/usr/local/lib/node_modules/appcelerator/lib/util.js:720

对于其他 Appcelerator 版本,util.js 中的行号可能不同。

我在编辑器中打开 util.js 并添加了一行以了解发生了什么:

console.log(cf);

现在我可以看到它试图读取哪个配置文件,在我的例子中结果是:

~/.appcelerator/appc-cli.json

这个 .json 文件是空的。删除此文件后,错误消失了。

现在 运行 appc setup 并输入您的凭据并回答其他提示,这将重新创建并重新写入 appc-cli.json.