Cli: heroku commands can't find node

Created on 2 Jun 2017  Â·  9Comments  Â·  Source: heroku/cli

I ran a heroku cli command and it updated my version of heroku-cli. When it finished updating, I'm no longer able to run any heroku commands. I get errors about not being able to find node:

~/code/my-app(master) heroku run iex -S mix -a my-app
/Users/peterbrown/.local/share/heroku/client/bin/heroku: line 21: /Users/peterbrown/.local/share/heroku/client/bin/node: No such file or directory
/Users/peterbrown/.local/share/heroku/client/bin/heroku: line 21: /Users/peterbrown/.local/share/heroku/client/bin/node: No such file or directory

Most helpful comment

what happens if you delete /Users/peterbrown/.local/share/heroku/client?

All 9 comments

what operating system and architecture are you on? does /Users/peterbrown/.local/share/heroku/client/bin/node exist?

OS X 10.12.5

The only thing that's in bin is heroku. I tried linking the node it can't find to my local node install just to see what happened, but just throws more errors:

module.js:472
    throw err;
    ^

Error: Cannot find module '/Users/peterbrown/.local/share/heroku/client/bin/heroku.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3
module.js:472
    throw err;
    ^

Error: Cannot find module '/Users/peterbrown/.local/share/heroku/client/bin/heroku.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

what happens if you delete /Users/peterbrown/.local/share/heroku/client?

That did it, thanks!

now the question is why was it partially installed... I'll start digging!

Heroku-error-Not a directory

Not a directory Error when executing Heroku commands

â–¸   stat /User/xxx/.local/share/heroku/client/bin/heroku: not a directory
â–¸   fork/exec /User/xxx/.local/share/heroku/client/bin/heroku: not a directory

Solution is to remove previous directory

rm -rf ~/.local/share/heroku/client

I just hit the same problem a minute ago. Mine was raised by partial install from a failed migration. Hope this helps.

Ran into this again myself just now. My error this time was

 'MODULE_NOT_FOUND': Cannot find module 'ts-lodash'

Same fix from before worked again.

I think I'm hitting this issue. Here's what I get

/usr/local/bin/heroku: line 19: /usr/local/opt/node/bin/node: No such file or directory

I've checked that /usr/local/opt/node/ doesn't exist.

I've tried removing nvm and getting the latest node. It didn't work. I also tried deleting my user's /.local/share/heroku/client, but that folder doesn't exist.

What are other options I can try?

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imujjwal96 picture imujjwal96  Â·  6Comments

noenthu picture noenthu  Â·  7Comments

dking74 picture dking74  Â·  7Comments

rpsadarangani picture rpsadarangani  Â·  5Comments

JBallin picture JBallin  Â·  6Comments