Installing Heroku on


#1

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 (https://www.railstutorial.org/book/beginning#sec-heroku_setup) and I’ve gotten everything set up except for Heroku. I’ve tried running the command included in the tutorial

source <(curl -sL https://cdn.learnenough.com/heroku_install)

But I receive the following output:

npm http GET https://registry.npmjs.org/n
npm http GET https://registry.npmjs.org/n
npm http GET https://registry.npmjs.org/n
npm ERR! Error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY
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 CleartextStream.read [as _read] (tls.js:521:13)
npm ERR!     at CleartextStream.Readable.read (_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!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

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
function

I’ve also tried:

wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh

But get this output:

+ SUDO=
++ 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
WARNING Node version must be >=8.0.0 to use this CLI
WARNING Current node version: 6.14.1
WARNING
/home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/heroku/node_modules/@oclif/command/lib/command.js:23
    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.


#2

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.


#3

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!


#4

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