Cannot find module 'heroku-run' - heroku

Tried to run heroku logs to check an error, got this:
$ heroku run rake db:migrate
! Error in heroku-run:
! Cannot find module 'heroku-run'
! See ~/.heroku/error.log for more info.
Now every time I run a heroku command I get that message. Tried updating heroku, no change. Tried installing heroku-run, not a gem. Checked the error log and it just says the same thing:
2016/04/09 22:51:45 Error: Cannot find module 'heroku-run'
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-021789235:34:14)
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)

For ubuntu I had to:
sudo aptitude purge heroku heroku-toolbelt
rm -rf ~/.heroku
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
before things started worked again.

I believe there was an issue with the heroku-toolbelt client for osx, run heroku update to get a fixed version.

Related

Cannot find module Heroku CLI package.json

I'm on MacOS and installed the Heroku CLI a few months ago and ran into this error trying to use the command line tools today:
Error: Cannot find module '{user profile}/.local/share/heroku/client/6.15.25-635e5c6/package.json'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at run ({user profile}/.local/share/heroku/client/6.15.25-635e5c6/node_modules/#cli-engine/engine/lib/cli.js:82:22)
at Object.<anonymous> ({user profile}/.local/share/heroku/client/6.15.25-635e5c6/bin/heroku.js:7:1)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
I tried brew uninstall heroku/brew/heroku and then reinstalling with no change in the error.
I found this issue on GitHub that fixed it.
The fix is just delete ~/.local/share/heroku/client and it worked fine again as normal.

How to solve error message "Cannot find module 'abbrev'

My question is very similar to How do I resolve "Cannot find module" error using Node.js? but I cannot solve my problem using the information provided in the answer given.
I try to run the UNCSS grunt plugin, but when I try to install it (npm install grunt-uncss --save-dev), I get the following error:
$ npm install grunt-uncss --save-dev
module.js:340
throw err;
^
Error: Cannot find module 'abbrev'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/Cellar/node/0.10.20/lib/node_modules/npm/node_modules/nopt/lib/nopt.js:10:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
Based on the answer mentioned above, I tried installing this 'abbrev' module, both in project folder, and globally, but this yields the exact same error :(
npm install -g abbrev
module.js:340
throw err;
^
Error: Cannot find module 'abbrev'
at Function.Module._resolveFilename (modu
(ETCETERA)
Main question: How to I solve this error?
Sub questions:
1) I wonder, is this a RUBY error or a NODE.JS error? I noticed 'abbrev' is also a Ruby command...?
2) Or, could this problem have arisen because I tried to solve the bus error: 10 ? (http://shoogledesigns.com/blog/blog/2014/01/13/gruntjs-running-watch-task-waiting-bus-error-10/)
I hope this question doesn't sound too obvious. I'm a front-end developer, but far from a command-line guru!
For me it has been solved by updating npm itself:
sudo npm install -g npm
Solution: re-installing node.js, as I mention in my last comment.
Tell-tale was the very same error-message every time I ran NPM.
Removing node_modules and then reinstalling the modules specified in my package.json worked for me.
I did that by runnning the following commands:
rm -rf node_modules
npm install
Neither one of the other two answers solved it for me, but both together did.
I had a very similar issue. Removing the entire node_modules folder and re-installing it's worked for me. I did that by running the following commands:
rm -rf node_modules
npm install
Windows user here. I tried re-installing Node.js (using installer) and it did not help. I had to run the rm -rf node_modules to remove the "node_modules" folder at the location listed in the error (midway down).
In the OP example it was at
Object. (/usr/local/Cellar/node/0.10.20/lib/node_modules/
It was something like C:\Users\nick\AppData\Roaming\npm\node_modules

installing zmq module on redHat linux RHEL 6.2 64bit machine

Hi I am trying to install zmq module on a linux machine.Below are the steps that i followed
• Make sure you have the following packages installed (sudo apt-get install binutils libtool autoconf automake)
• Get the latest POSIX tarball (http://zeromq.org/intro:get-the-software) and untar it
• Run configure (./configure)
• Run make (sudo make install)
• npm install zmq or npm update if you already have it listed in your package.json
• sudo ldconfig (otherwise you might get the error "connot open shared object file")
But when i ran the above steps i got the error as below
Error: libzmq.so.3: cannot open shared object file: No such file or directory
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/var/MLIDeployment/MLI/zeromq-4.0.3/node_modules/zmq/lib/index.js:8:11)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I'm stuck here any help regarding this will be much helpful
The error you are getting is that libzmq.so cannot not found.
You need to add the install directory (defaults to /usr/local/lib) to LD_PATH.
To add it you need to execute:
sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/local-lib.conf
sudo ldconfig
Hope this works.

node.js on Mac OS X npm "Error: No such module"

I have installed node.js v0.8.8 both from the pkg installer and compiled from source. Yet I get the following error when trying to run npm. Any help would be appreciated.
> $ npm --help
>
> /usr/lib/node_modules/npm/lib/utils/config-defs.js:5 , stdio =
> process.binding("stdio")
> ^ Error: No such module
> at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
> at Module._compile (module.js:449:26)
> at Object.Module._extensions..js (module.js:467:10)
> at Module.load (module.js:356:32)
> at Function.Module._load (module.js:312:12)
> at Module.require (module.js:362:17)
> at require (module.js:378:17)
> at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/ini.js:43:18)
> at Module._compile (module.js:449:26)
> at Object.Module._extensions..js (module.js:467:10)
I had the exact same issue upgrading from Node.JS 0.4 to 0.8. What worked for me was the following:
The OSX Node.JS package installer erroneously does not remove the old 0.4 npm installation in /usr/bin, which then conflicts with the new 0.8 one in /usr/local/bin. It just overwrites whatever is there already. I nuked the old one by deleting it, but to make sure, I decided a clean install would be better:
curl https://npmjs.org/install.sh | sudo clean=yes sh
There was one last problem: after the install, even though a which npm correctly returns /usr/local/bin/npm, bash kept trying to execute from /usr/bin. This is because on OSX, bash has hashed the executable name. The hashing saves repeated searches of all directories in your PATH every time you execute common programs. A hash -r at the command line took care of this issue.
You are most likely using an old NPM version somehow.
see: npm issue

npm install successfully but node web.js erros w: "Error: Cannot find module"

I'm working to get node running on a new mac. I downloaded the installed at http://nodejs.org/
I then git cloned my node repo, ran npm install and npm update, and then node web.js which then errors with:
$ node web.js
Error: Cannot find module '/Users/me/Sites/mysite-node/node_modules/pg/lib/native/../../build/default/binding'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/Users/me/Sites/mysite-node/node_modules/pg/lib/native/index.js:12:12)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
I'm new to node, any ideas or suggestions on where to look? Thanks
You need to install the postgresql libraries on your machine. For example under Fedora you'd:
yum install postgresql.x86_64
yum install postgresql-server.x86_64
If you already had pg install you'd need to rebuild it:
npm rebuild pg
Then to verify everything is working at the terminal type:
node
Then in the node REPL type:
var pg = require('pg').native
And you shouldn't get an error
The Error shows that npm installation of the pg module has not built the native bindings properly. Modify your code as follows:
//var pg = require('pg').native;
var pg = require('pg');

Resources