克隆ui示例后,我遇到以下错误消息:
~/workspace/m2m-cumulocity-ui-plugin-examples$ c8y install latest /usr/local/lib/node_modules/cumulocity-tools/cli/options.js:33
let t = program.target;
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/cumulocity-tools/cli/bin.js:5:17)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
我在哪里设置strict_mode?我认为必须在错误消息中指向的options.js中设置它。但那不会起作用。 有什么想法吗?
谢谢。
编辑: 我退后一步,切换到没有代理设置的另一台机器,并尝试再次安装cumulocity-tools。
这次我得到了:
npm i cumulocity-tools -g
/usr/local/lib
└── (empty)
npm ERR! Linux 4.4.0-79-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "cumulocity-tools" "-g"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: x64
npm ERR! Please include the following file with any support request:
npm ERR! /home/c8y/npm-debug.log
npm ERR! code 1
npm似乎已经过时,所以我先更新了它。 我需要用
关闭git的代理设置Git config –global –unset http.proxy
然后:
Npm update –g
之后,npm更新为v5.0.3
再次尝试安装工具:
sudo npm i cumulocity-tools -g
现在可行。
安装最新版本:
sudo c8y install latest
我现在尝试部署其中一个样本。