I'm running node v0.12.7, and installed protractor through npm.
Now I'm trying to run the conf.js using this simple tutorial, and I get the following error when executing the command 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)
Can't update node due to dependency issues it will produce (I'm working on an already-built project which used node 0.12.17).
Using --harmony flag on protractor doesn't work. Do I need to install a specific version of protractor to be compatible with node 0.12.7? Or should I use babeljs to compile ES6 to ES5?
If babeljs is the answer, how would I use it for protractor?
Do I need to install a specific version of protractor to be compatible with node 0.12.7
You need protractor version 2.
From https://github.com/angular/protractor#compatibility
Related
I have been working in AngularJS for a while now and I decided to try out Vue. I installed Vue using npm install -g #vue/cli in my terminal using Node version 6.4.0. After the installation was complete I tried creating a new app using vue create <name of app>. It's during this seemingly simple step that I am getting hung up with this error:
/Users/jonalden/.nvm/versions/node/v6.4.0/lib/node_modules/#vue/cli/node_modules/open/index.js:16
const wslToWindowsPath = async path => {
^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:528:28)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/jonalden/.nvm/versions/node/v6.4.0/lib/node_modules/#vue/cli/node_modules/#vue/cli-shared-utils/lib/openBrowser.js:9:14)
at Module._compile (module.js:556:32)
I have tried downgrading Node to a previous version and reinstalling Vue with Yarn but both were unsuccessful. One thing throwing me off here is the line wslToWindowsPath, which is especially weird since I am on a Mac.
I had the same problem. I've done this :
sudo rm -rf ~/.nvm
I am trying to run my project with node server.js and i am getting following error.
/Library/WebServer/Documents/PROJECT/node_modules/express-validator/lib/express_validator.js:75
chain[name] = (...options) => {
^^^
SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Library/WebServer/Documents/PROJECT/node_modules/express-validator/index.js:1:80)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
I am using Express.js framework. It was working fine last time when i worked on it.
After searching a lot i finally found that for one of my project which was build with nodejs older version i was using node#4.4.7 and after changing node version on my local machine with following:
nvm ls // to check out what versions of Node.js are installed on your machine
-> v4.4.7
v8.9.1
system
default -> 4.4.7 (-> v4.4.7)
To switch Node.js from node#4.4.7 to node#8.9.1 i have used following command:
nvm use v8.9.1
To verify i check again with nvm ls and now it shows.
v4.4.7
-> v8.9.1
system
default -> 4.4.7 (-> v4.4.7)
Yes the spread operator which is available in ES6 will be available form versions 8 and above for node 8 .
I keep getting this error message, and I'm unable to trouble-shoot this or see where anyone else is having the same problem.
I followed the instructions to install this on Linux, but audiosprite is producing this error message. Is this an issue with audiosprite? Or nodejs? Or something else?
Using v4.2.6 of node if that matters:
# audiosprite --help
/usr/local/lib/node_modules/audiosprite/audiosprite.js:31
let opts = {}, callback = function(){}
^^^
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/audiosprite/cli.js:7:19)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
Upgrade your nodejs and npm version. The keyword let,const are not supported by v4.0. You have to update version
The module n makes version-management easy:
sudo npm install n -g
sudo n 0.12.2
For the latest stable version:
sudo n stable
For the latest version:
sudo n latest
Trying to execute heroku login:
heroku login
WARNING
WARNING Node version must be >=7.10.0 to use the Heroku CLI
WARNING
/opt/npm-global/lib/node_modules/heroku-cli/node_modules/cli-engine/lib/cli.js:73
async run() {
^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/opt/npm-global/lib/node_modules/heroku-cli/bin/run.js:10:34)
at Module._compile (module.js:570:32)
Looks like your version of Node is out of date. I was having the same problem while trying to add heroku as a place I could push code to while in Cloud9. The commands below will help if you're using nvm.
$ node --version
v4.7.3
$ nvm install 8.1.3
Downloading https://nodejs.org/dist/v8.1.3/node-v8.1.3-linux-x64.tar.xz...
######################################################################## 100.0%
Now using node v8.1.3 (npm v5.0.3)
$ node --version
v8.1.3
After this, I didn't get that error. If this doesn't help then you may want to google around for how to update Node. This may be worth a shot: https://stackoverflow.com/a/41196107. Good luck!
I'm trying to install the polymer CLI from here: https://www.polymer-project.org/1.0/docs/tools/polymer-cli
However, after installing it I get an error when trying to run polymer help:
[~/Documents/roottest]$ polymer help ruby:2.2.4
/opt/boxen/nodenv/versions/v0.10.26/lib/node_modules/polymer-cli/bin/polymer.js:19
let lib = path ? require(path) : require('..');
^^^
SyntaxError: Unexpected strict mode reserved word
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 Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
[~/Documents/roottest]$ node --version ruby:2.2.4
v0.10.26
[~/Documents/roottest]$ nodenv --version ruby:2.2.4
nodenv 0.3.3
My node version is v0.10.26, my nodeenv version is 0.3.3. I'm using Mac.
Does anyone know how I would fix this?
Polymer CLI is not compatible with Node v0.10.26.
The setup guide indicates that Node 4.x or newer is required. You should actually upgrade to the latest stable version (6.2.0).