0

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)
Vikas
  • 4,184
  • 2
  • 12
  • 9

1 Answers1

1

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!

Vampiro
  • 103
  • 7