Installation 完整Nativescript CLI安装/测试问题

Installation 完整Nativescript CLI安装/测试问题,installation,command-line-interface,nativescript,tns,Installation,Command Line Interface,Nativescript,Tns,我已经在MacOS X上完成了Nativescript CLI的干净安装,但当我运行tns doctor时,它失败了: bash-3.2$ /usr/local/lib/node_modules/nativescript/bin/tns doctor /usr/local/lib/node_modules/nativescript/lib/common/verify-node- version.js:32 console.warn((`${os.EOL}${nod

我已经在MacOS X上完成了Nativescript CLI的干净安装,但当我运行tns doctor时,它失败了:

bash-3.2$ /usr/local/lib/node_modules/nativescript/bin/tns doctor

/usr/local/lib/node_modules/nativescript/lib/common/verify-node-    version.js:32
            console.warn((`${os.EOL}${nodeWarning.message}${os.EOL}`).yellow.bold)
                  ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous>     (/usr/local/lib/node_modules/nativescript/bin/tns:8:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
bash-3.2$/usr/local/lib/node_modules/nativescript/bin/tns-doctor
/usr/local/lib/node_modules/nativescript/lib/common/verify node-version.js:32
console.warn(`${os.EOL}${nodeWarning.message}${os.EOL}`)黄色.粗体)
^
SyntaxError:意外标记非法
在模块处编译(Module.js:439:25)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)
在Function.Module.\u加载(Module.js:312:12)
at Module.require(Module.js:364:17)
根据需要(模块js:380:17)
反对。(/usr/local/lib/node_modules/nativescript/bin/tns:8:1)
在模块处编译(Module.js:456:26)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)

问题在于您使用的是非常旧的Node.js版本。NativeScript CLI至少需要Node.js 6,但我建议您使用当前的LTS-Node.js 10。
Node.js 0.10.29(当前版本)不支持NativeScript CLI的代码库中使用的语法。

前一个问题是由于Node js的过时版本造成的;节点10(LTS)的安装解决了这一问题


后一个问题是由于python的编写嵌套造成的——命令“python”链接到python2.5,而安装脚本调用python2.7及其附带的用户插件。将“python”重新链接到python 2.7可执行文件修复了此问题。

看起来您使用的是不受支持的Node.js版本。
节点--version
的输出是什么?bash-3.2$node--version v0.10.29您是对的,但最新的CLI(5.x)至少需要节点8。谢谢-macOS x Mojave上的节点更新/升级过程给了我v0.10.29;安装Node8使我走得更远。现在的问题是:bash-3.2$sudo tns医生密码:*********module.js:550 throw err;^错误:找不到模块“semver”…我假设这是一个路径问题,但将链接移动到模块目录的所有位置似乎都不能解决问题。