Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Error reading plugin: heroku-local #1690

Open
datewu opened this issue Aug 13, 2015 · 41 comments
Open

Error reading plugin: heroku-local #1690

datewu opened this issue Aug 13, 2015 · 41 comments

Comments

@datewu
Copy link

datewu commented Aug 13, 2015

er , iam poor with english, so, i will paste some 'log' here:

After i installed the pkg file, i typed heroku in my terminal and an error came out:

error

~  heroku
Error reading plugin: heroku-local. See /Users/haha/.heroku/error.log for more information.

the log files

~  cat /Users/haha/.heroku/error.log
2015/03/26 13:22:29 done
2015/03/26 13:22:30 Installing plugin heroku-local...
2015/03/26 13:22:48 done
2015/03/31 13:49:04 updating plugins...
2015/03/31 13:49:05 done
2015/03/31 13:49:10 updating to 4.12.2-ed2563f (master)...
2015/08/13 13:48:00 Error reading plugin: heroku-local. See /Users/haha/.heroku/error.log for more information.
2015/08/13 13:48:00 exit status 1
 /Users/haha/.heroku/node_modules/heroku-local/node_modules/heroku-cli-util/lib/rollbar.js:71
          }
          ^
SyntaxError: Unexpected token }
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:427:25)
    at Object.Module._extensions..js (module.js:462:10)
    at Module.load (module.js:339:32)
    at Function.Module._load (module.js:294:12)
    at Module.require (module.js:349:17)
    at require (module.js:368:17)
    at Object.<anonymous> (/Users/haha/.heroku/node_modules/heroku-local/node_modules/heroku-cli-util/index.js:27:24)
    at Module._compile (module.js:444:26)
    at Object.Module._extensions..js (module.js:462:10)

and i find nothing wrong wtih the js file

Then i went to your github page

the moment i saw npm install heroku-cli-util --save.....:)

Nobody tells me heroku toolbelt has changed itself from a ruby gem to npm!

At least not your site

so after i install npm

~  brew install npm
==> Downloading https://homebrew.bintray.com/bottles/node-0.12.6.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring node-0.12.6.yosemite.bottle.tar.gz
==> Caveats

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/node/0.12.6: 2726 files, 29M
➜  ~  heroku
Usage: heroku COMMAND [--app APP] [command-specific-options]

everthing goes fine now.

detail does matter! :)

i hope i do some help here.

@jdx jdx changed the title ' heroku toolbelt for mac os x ' must install npm first Error reading plugin: heroku-local Aug 13, 2015
@jdx
Copy link
Contributor

jdx commented Aug 13, 2015

Installing npm is a red herring—something else went wrong here though it's hard to tell what. I wonder if perhaps it only had partially installed the plugin or was updating it while it attempted to run it.

@haysmike
Copy link

I was getting this as well. Log:

2015/08/26 18:28:55 Error reading plugin: heroku-local. See /Users/mike/.heroku/error.log for more information.
2015/08/26 18:28:55 exit status 1
 module.js:338
    throw err;
    ^

Error: Cannot find module 'extend'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/mike/.heroku/node_modules/heroku-local/node_modules/request/index.js:17:29)
    at Module._compile (module.js:430:26)
    at Object.Module._extensions..js (module.js:448:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

heroku plugins:uninstall heroku-local followed by heroku plugins (which automatically reinstalled heroku-local) got rid of the error for me. Hope that helps you.

@b3ccio
Copy link

b3ccio commented Oct 1, 2015

+1 @Murkey

@zdbrandt
Copy link

zdbrandt commented Oct 5, 2015

I'm getting this same "Error reading plugin: heroku-local" error now. The syntax error that is thrown is a little different but it's along the same lines. When I check the JS file it all looks good:

/Users/USER/.heroku/node_modules/heroku-local/lib/download.js:17
.then(() => fs.renameSync(tmpPath, path));

SyntaxError: Unexpected token )
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:448: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. (/Users/zbrandt/.heroku/node_modules/heroku-local/lib/forego.js:6:16)
at Module._compile (module.js:430:26)
at Object.Module._extensions..js (module.js:448:10)

@jdx
Copy link
Contributor

jdx commented Oct 8, 2015

I'm pretty sure npm just fails at downloading sometimes. I've seen this error a handful of times myself but it's not reproducible. If someone continually gets this error let me know. Because this package exists, I don't think I'm the only one: https://github.com/AlexCline/npm-install-missing.

The good news is I have some retry logic around this to autorepair broken package downloads. This should make this a bit annoying, but everything should still work assuming the second download passes.

Because npm 3 works totally differently when downloading these sub-dependencies, I'd like to try to move to that to see if it fixes the problem.

@reggi
Copy link

reggi commented Oct 28, 2015

Not sure what's happening but I'm stuck & it's super frustrating.

thomas@workstation:~$ heroku
Error reading plugin heroku-local. Reinstalling... ERROR: module.js:338
    throw err;
    ^

Error: Cannot find module 'heroku-local'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at [eval]:2:15
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:434:26)
    at node.js:566:27
    at doNTCallback0 (node.js:407:9)

 !    error getting commands pid 28410 exit 1

@reggi
Copy link

reggi commented Oct 28, 2015

This fixed it:

rm -rf /usr/local/heroku
rm -rf ~/.heroku

@zmackie
Copy link

zmackie commented Nov 2, 2015

@reggi +1
I only had to run rm -rf ~/.heroku as /usr/local/heroku didn't exist.

@eebs
Copy link

eebs commented Nov 4, 2015

I ran into the same issue as @reggi. Removing ~/.heroku fixed it for me as well.

@ktrain
Copy link

ktrain commented Nov 9, 2015

I had a similar problem (on Linux):

Error reading plugin heroku-apps. Reinstalling... ERROR: heroku-apps: module.js:339
    throw err;
    ^

Error: Cannot find module 'heroku-cli-util'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/ksteffen/.heroku/node_modules/heroku-apps/commands/apps/info.js:6:16)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)

 !    error getting commands pid 24745 exit 1

And moving/removing ~/.heroku fixed it for me, as well. Thanks to all.

@olegsokolov513
Copy link

Cool

@nessche
Copy link

nessche commented Dec 16, 2015

removing ~/.heroku/plugin-cache.json may be enough (without removing the whole .heroku directory)

@DannyBen
Copy link

Just to contribute my part to the great people of heroku.

This happened to me when running promote (heroku pipelines:promote -r heroku) - so not related to heroku local, but seems to be same error.

Rerunning the command works well and gives no errors, but this got me worried a little.

Here are the relevant lines from the log:

2015/12/18 09:07:28 Updating Heroku v4 CLI to 4.27.9-cce0260 (master)...
2015/12/18 09:07:30 done
2015/12/18 09:07:30 Updating plugins...
2015/12/18 09:07:50 done
2015/12/18 09:07:50 rebuilding plugins cache...
2015/12/18 09:07:53 Error reading plugin: signal-exit. See /home/vagrant/.he
2015/12/18 09:07:53 exit status 1
 module.js:339
    throw err;
    ^
Error: Cannot find module 'signal-exit'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at [eval]:2:15
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:425:26)
    at node.js:587:27
    at doNTCallback0 (node.js:428:9)
    at doNTCallback0 (node.js:428:9)
2015/12/18 09:07:57 Error reading plugin: semver. See /home/vagrant/.heroku/
2015/12/18 09:07:57 exit status 1
 module.js:339
    throw err;
    ^
Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at [eval]:2:15
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:425:26)
    at node.js:587:27
    at doNTCallback0 (node.js:428:9)
2015/12/18 09:07:57 Error reading plugin: path-exists. See /home/vagrant/.he
2015/12/18 09:07:57 exit status 1
 module.js:339
2015/12/18 09:07:57 exit status 1
 module.js:339
    throw err;
    ^
Error: Cannot find module 'path-exists'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at [eval]:2:15
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:425:26)
    at node.js:587:27
    at doNTCallback0 (node.js:428:9)
2015/12/18 09:07:57 Error reading plugin: loud-rejection. See /home/vagrant/
2015/12/18 09:07:57 exit status 1
 module.js:339
    throw err;
    ^

@jdx
Copy link
Contributor

jdx commented Dec 21, 2015

@DannyBen I think your issue was resolved. Do you continue to get it after a heroku update?

@DannyBen
Copy link

Well, I only got it once, and it resolved itself after simply rerunning.
The log I posted above did say Updating Heroku v4 CLI to 4.27.9-cce0260 (master) so I guess this is the reason why it looked like it resolved itself.

I haven't seen this error since, will post here again if I do.
Let me know if more information is required.

EDIT:
This is my heroku version:

$ heroku --version
heroku-toolbelt/3.42.25 (x86_64-linux) ruby/2.2.1
heroku-cli/4.27.9-cce0260 (amd64-linux) go1.5.2
=== Installed Plugins
heroku-apps@0.5.4
heroku-cli-addons@0.1.0
heroku-fork@4.0.0
heroku-git@2.4.4
heroku-local@4.1.5
heroku-pipelines@0.27.1
heroku-run@2.9.2
heroku-status@1.2.4

@jdx
Copy link
Contributor

jdx commented Dec 21, 2015

yeah that's exactly what happened, the update had the fix but it didn't run the updated version of the CLI until the next time you ran it.

@TheNaoX
Copy link

TheNaoX commented Feb 16, 2016

I don't know exactly how to fix this issue

@jdx
Copy link
Contributor

jdx commented Feb 16, 2016

try again, you were probably experiencing this https://status.heroku.com/incidents/851

@NathanielGiron
Copy link

please check @Murkey 's solution, it worked for me

@davidmesaros
Copy link

Removing ~/.heroku fixed it for me as well.

@brookinc
Copy link

This just happened to me, seemingly spontaneously? Yesterday, heroku local worked fine; today, it's nothing but:

 !   Error in heroku-local:
 !   Cannot find module 'heroku-local'
 !   See /home/vagrant/.heroku/error.log for more info.

Unfortunately, neither @Murkey's solution (heroku plugins:uninstall heroku-local followed by heroku plugins) nor @reggi's (rm -rf /usr/local/heroku and rm -rf ~/.heroku) fixed it for me. I even tried uninstalling and then reinstalling the whole heroku CLI, but to no avail -- the heroku-local plugin would not install correctly for me:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/myproject$ heroku local
Heroku CLI submits usage information back to Heroku. If you would like to disable this, set `skip_analytics: true` in /home/vagrant/.heroku/config.json
 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       No such file or directory - /home/vagrant/.heroku/config.json (Errno::ENOENT)
    Command:     heroku local
    Version:     heroku-toolbelt/3.42.49 (x86_64-linux) ruby/1.9.3
    Error ID:    5082de1b664740bcb02f9c92a31ce80f

    More information in /home/vagrant/.heroku/error.log

Finally, I tried wiping and then reprovisioning my dev VM from scratch (I use Vagrant). The heroku CLI seemed to install successfully:

==> default: Selecting previously unselected package heroku.
==> default: Preparing to unpack .../heroku_3.42.49_all.deb ...
==> default: Unpacking heroku (3.42.49) ...
==> default: Selecting previously unselected package heroku-toolbelt.
==> default: Preparing to unpack .../heroku-toolbelt_3.42.49_all.deb ...
==> default: Unpacking heroku-toolbelt (3.42.49) ...
==> default: Setting up heroku (3.42.49) ...
==> default: Setting up heroku-toolbelt (3.42.49) ...

...but none of the plugins did:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/myproject$ heroku local
heroku-cli: Installing Toolbelt v4... done
heroku-cli: Adding dependencies... 6.68 MB/6.68 MB
heroku-cli: Adding dependencies... 2.57 MB/2.57 MB
heroku-cli: Updating plugins...heroku-cli: Installing core plugins...module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-git'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/tmp/heroku-script-583295415:2:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-apps'
[...identical callstack to above...]
    at Function.Module.runMain (module.js:447:10)
module.js:341
module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-fork'
[...identical callstack to above...]
    at Function.Module.runMain (module.js:447:10)
    throw err;
    ^

Error: Cannot find module 'heroku-run'
[...identical callstack to above...]
    at Function.Module.runMain (module.js:447:10)
module.js:341
module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-local'
[...identical callstack to above...]
    at Function.Module.runMain (module.js:447:10)
    throw err;
    ^

(...snipping ~400 similar lines...)

Error: Cannot find module 'heroku-pipelines'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/tmp/heroku-script-041039531:2:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-fork'
[...identical callstack to above...]
    at Function.Module.runMain (module.js:447:10)
 !
 ▸    Error reading plugin: heroku-fork
 ▸    exit status 1
 !    error getting commands pid 17276 exit 1

Any idea what might be going on? Is there a server-side issue that could be preventing the plugins from installing correctly? Is there anything else I can try in the mean time?

@DavidVII
Copy link

@brookinc I suddenly started getting the same errors Error: Cannot find module

None of the solutions described here worked 😭

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

I shipped a change earlier to make plugin loading happen in parallel, that was probably causing this. I rolled it back, so can you try deleting ~/.heroku/node_modules and trying again?

@DavidVII
Copy link

Hi @dickeyxxx, after your comment I uninstalled everything and tried to re-install... no dice.

here's the output:

~ heroku login
Heroku CLI submits usage information back to Heroku. If you would like to disable this, set `skip_analytics: true` in /Users/David/.heroku/config.json
heroku-cli: Installing Toolbelt v4... done
For more information on Toolbelt v4: https://github.com/heroku/heroku-cli
heroku-cli: Adding dependencies... 5.13 MB/5.13 MB
heroku-cli: Adding dependencies... 2.57 MB/2.57 MB
heroku-cli: Updating plugins...heroku-cli: Installing core plugins...module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-apps'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/private/var/folders/1s/pbmq_7xs2333k8hwjl2kxxmm0000gn/T/heroku-script-812764627:2:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
heroku-cli: Installing core plugins (retrying)...module.js:341
    throw err;
    ^

Error: Cannot find module 'heroku-apps'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/private/var/folders/1s/pbmq_7xs2333k8hwjl2kxxmm0000gn/T/heroku-script-998557565:2:15)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
 !
 ▸    Error reading plugin: heroku-apps
 ▸    exit status 1
 ▸    module.js:341
 ▸        throw err;
 ▸        ^
 ▸    
 ▸    Error: Cannot find module 'heroku-apps'
 ▸        at Function.Module._resolveFilename (module.js:339:15)
 ▸        at Function.Module._load (module.js:290:25)
 ▸        at Module.require (module.js:367:17)
 ▸        at require (internal/module.js:16:19)
 ▸        at Object.<anonymous> (/private/var/folders/1s/pbmq_7xs2333k8hwjl2kxxmm0000gn/T/heroku-script-305538232:2:15)
 ▸        at Module._compile (module.js:413:34)
 ▸        at Object.Module._extensions..js (module.js:422:10)
 ▸        at Module.load (module.js:357:32)
 ▸        at Function.Module._load (module.js:314:12)
 ▸        at Function.Module.runMain (module.js:447:10)
 !    error getting commands pid 2977 exit 1```

@jacobtipp
Copy link

I am having the same problems as @brookinc and @DavidVII. Just started happening today after I ran

heroku logs 

I tried reinstalling the CLI, rm -rf ~/.heroku and still nothing, it seems to fail installing core plugins

EDIT:

@dickeyxxx I tried removing the node_modules directory from ~/.heroku and I'm still having the same problems. We seem to be getting an infinite loop of heroku-cli trying to install core plugins and it never finds the modules for them.

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

can you show me the output of heroku version?

@brookinc
Copy link

Hi @dickeyxxx -- thanks for the reply. I ran rm -rf ~/.heroku/node_modules, but running heroku local still tries to install the heroku-cli core plugins, which still gives me the same error spew.

Even heroku version first tries to install the core plugins, which throws the same error spew.

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

OK I'm going to roll back the changes I pushed out earlier entirely

@jacobtipp
Copy link

@dickeyxxx, no heroku commands in the CL are working, it just tries to install core plugins everytime you throw it a heroku command

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

it's rolling back now, if you update to 4.29.4-8867943 it should be fixed

@jacobtipp
Copy link

@dickeyxxx,

I just reinstalled the toolbelt to make sure, everything is working now.

Thanks a bunch!

Also, just wanted to point out, before the rollback heroku-toolbelt after installation was failing to read the config.json in ~/.heroku/config.json, I'm not sure if that was part of the problem or not as I did not get that error this time around.

@DavidVII
Copy link

Awesome! Thank you, @dickeyxxx! All seems to be working well again.

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

@traducer I noticed that too and put a patch in for that. Sorry for the trouble here!

@brookinc
Copy link

When I uninstall (sudo apt-get remove heroku-toolbelt) and then reinstall (wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh), it gives me version 3.42.50 (earlier today was 3.42.49, I think?). However, the issue is still happening with v3.42.50 for me. Can I force the installer to get the 4.29.4-8867943 version you mention? Is there a different apt-get source I need to add, or...?

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

@brookinc it's a little confusing, there is a v3 and v4 branch of the CLI, you should have both of them.

@brookinc
Copy link

Hmm, okay. Should the uninstall and reinstall commands referenced above do the trick, then? I'm not sure what else to try.

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

delete ~/.heroku if you're still having trouble

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

btw do any of you happen to have NODE_PATH set?

@DavidVII
Copy link

@dickeyxxx I do.

~/.nvm/v0.12.7/lib/node_modules

@brookinc
Copy link

Thanks, rm -rf ~/.heroku did the trick!

I also have NODE_PATH set:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/myproject$ printenv NODE_PATH
/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript

@jdx
Copy link
Contributor

jdx commented Apr 10, 2016

yeah I'm pretty sure NODE_PATH is where the problem came from. I wasn't correctly overwriting it.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests