运行vs mda远程时出现错误



我按照https://msdn.microsoft.com/en-us/library/dn771551.aspx安装vs mda远程。我唯一注意到的是以下内容:

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远程时,我会得到以下错误:

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

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

  • 在终端中键入:export LANG=en_US。UTF-8
  • 通过启动node.js CLI(在终端中键入"node"),然后键入"process.env"进行验证

最新更新