0

I installed node.js and protractor from here, official protractor test site. I can see the version of node and npm but when I run following command to check the version of protractor installed I get following message.

C:\>protractor -v
C:\Users\<>\AppData\Roaming\npm\node_modules\protractor\built\cli.js:3
const fs = require("fs");
^^^^^
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\<>\AppData\Roaming\npm\node_modules\protractor\bin\protractor:5:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

What am I missing or doing wrong?

Chuchoo
  • 823
  • 2
  • 17
  • 36

2 Answers2

0

in any local directory this should work protractor --version

Joaquin Casco
  • 704
  • 5
  • 14
0

I already had an old version of nodejs in my "Program Files(X86)" directory. I deleted the old version of nodejs and reinstalled the latest version from here. I am not getting above error anymore.

I found answer in this post: https://stackoverflow.com/a/18412505/4086794

Chuchoo
  • 823
  • 2
  • 17
  • 36