在严格模式下的节点0.12.x const问题

我正在运行节点v0.12.7,并通过npm安装量angular器。 现在我试图用这个简单的教程来运行conf.js,并且在执行命令protractor conf.js时出现以下错误:

 [launcher] Process exited with error code 1 C:\Users\ramtin\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\index.js:25 const builder = require('./builder'); ^^^^^ SyntaxError: Use of const in strict mode. at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) 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 Module.require (module.js:365:17) at require (module.js:384:17) at Object.<anonymous> (C:\Users\ramtin\AppData\Roaming\npm\node_modules\protractor\built\protractor.js:3:17) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) 

不能更新节点,因为它会产生依赖关系问题(我正在使用节点0.12.17的已经build好的项目上工作)。

在量angular器上使用--harmony标志不起作用。 我是否需要安装量angular器的特定版本才能兼容节点0.12.7? 或者我应该使用babeljs编译ES6ES5

如果babeljs是答案,我将如何使用它作为量angular器?

我是否需要安装量angular器的特定版本才能兼容节点0.12.7

你需要量angular器版本2。

https://github.com/angular/protractor#compatibility

在这里输入图像描述