Installing Heroku on


I am brand new to cloud9 and using an IDE. I created a Cloud9 account via AWS. I’m trying to follow this Ruby on Rails tutorial ( and I’ve gotten everything set up except for Heroku. I’ve tried running the command included in the tutorial

source <(curl -sL

But I receive the following output:

npm http GET
npm http GET
npm http GET
npm ERR!     at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR!     at SecurePair.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR!     at [as _read] (tls.js:521:13)
npm ERR!     at (_stream_readable.js:341:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR!     at doWrite (_stream_writable.js:226:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:216:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR!     at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR!     <>
npm ERR! or email it to:
npm ERR!     <>

npm ERR! System Linux 4.9.91-40.57.amzn1.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "n" "-g"
npm ERR! cwd /home/ec2-user/environment/hello_app
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ec2-user/environment/hello_app/npm-debug.log
npm ERR! not ok code 0
sudo: n: command not found
bash: /usr/local/bin/npm: No such file or directory

I’ve also tried:

wget -qO- | sh

But get this output:

++ id -u
+ '[' 500 '!=' 0 ']'
+ SUDO=sudo
+ echo 'This script requires superuser access to install apt packages.'
This script requires superuser access to install apt packages.
+ echo 'You will be prompted for your password by sudo.'
You will be prompted for your password by sudo.
+ sudo -k
+ sudo sh
+ dpkg -s apt-transport-https
+ echo ''
sh: line 4: /etc/apt/sources.list.d/heroku.list: No such file or directory

Lastly, when I run heroku --version I get this:

WARNING Node version must be >=8.0.0 to use this CLI
WARNING Current node version: 6.14.1
    async _run() {

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/heroku/node_modules/@oclif/command/lib/index.js:24:19)

At this point I’m afraid to do much more since I really don’t know what I’m doing. Is there another way to get Heroku up and running on this IDE? Please let me know if there are any other configuration/settings I should include to assist with troubleshooting.



Well after all that I ran the following:

nvm i v8

And got

v8.11.1 is already installed.
Now using node v8.11.1 (npm v5.6.0)

Then ran:

npm install -g heroku

And heroku --version output:

heroku/7.0.15 linux-x64 node-v8.11.1

I swear I tried that already (as evidenced by the “v8.11.1 is already installed.” message. No idea why it worked that time.



Thank you so much dude!I am on the same tutorial and i have been trying for 2 hours now to deal with this and only your suggestion worked.Love ya!



Glad it helped! Keep this handy as you’ll have to run it for each new repository.



Hi. I found the suggested solution somewhere else and used it to produce the results needed. However, whenever my EC2 instance quits because I exceed the time limit, I have to log in again. When I do, the EC2 instance has “lost” heroku. Typing heroku -v produces an error message that heroku is unknown. Redoing the npm command again restores everything and all is fine. Is there somewhere I can put this command so that when the EC2 instance restarts it runs the npm command as part of the EC2 startup?