运行vs-mda-remote时出错

时间:2015-02-19 04:14:57

标签: node.js macos cordova

我按照https://msdn.microsoft.com/en-us/library/dn771551.aspx上的说明操作 安装vs-mda-remote。我唯一注意到的是:

npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.0","npm":"2.5.1"})
npm WARN engine cordova-js@3.7.2: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.0","npm":"2.5.1"})
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.0","npm":"2.5.1"})

然而,根据我所知,安装成功完成。 但是当我执行vs-mda-remote时,我收到以下错误:

vs-mda-remote
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
0.2.7

/usr/local/lib/node_modules/vs-mda-remote/lib/cli.js:46
        'lang': process.env.LANG.replace(/_.*/,""), // Convert "en_US.UTF8" to
                                ^
TypeError: Cannot read property 'replace' of undefined
    at module.exports (/usr/local/lib/node_modules/vs-mda-remote/lib/cli.js:46:33)
    at Object.<anonymous> (/usr/local/lib/node_modules/vs-mda-remote/bin/vs-mda-remote:10:5)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

之前有没有遇到过这个? Mac上安装的NodeJS版本为0.12

1 个答案:

答案 0 :(得分:8)

user2458203做对了,关键是设置LANG环境变量。如果你不熟悉Mac OS(就像我一样),这里有一个更详细的版本:

  • 在终端中键入:export LANG = en_US.UTF-8
  • 通过启动node.js CLI(键入&#34;节点&#34;进入终端)验证它,然后键入&#34; process.env&#34;。如果你看到你的新&#34; LANG&#34;输出中的变量,你很高兴,vs-mda-remote现在可以正常工作