Skip to content

Instantly share code, notes, and snippets.

@squeedee
Created October 26, 2011 17:46
Show Gist options
  • Select an option

  • Save squeedee/1317126 to your computer and use it in GitHub Desktop.

Select an option

Save squeedee/1317126 to your computer and use it in GitHub Desktop.
Not finding npm'ed module
var sys = require('sys');
var amqp = require('amqp');
var connection = amqp.createConnection({ host: 'rash.local' });
// Wait for connection to become established.
connection.on('ready', function () {
// Create a queue and bind to all messages.
// Use the default 'amq.topic' exchange
var q = connection.queue('my-queue');
// Catch all messages
q.bind('#');
// Receive messages
q.subscribe(function (message) {
// Print messages to stdout
sys.p(message);
});
});
[rasheed@rash Desktop]$ node amqp_test.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'amqp'
at Function._resolveFilename (module.js:326:11)
at Function._load (module.js:271:25)
at require (module.js:355:19)
at Object.<anonymous> (/Users/rasheed/Desktop/amqp_test.js:2:12)
at Module._compile (module.js:411:26)
at Object..js (module.js:417:10)
at Module.load (module.js:343:31)
at Function._load (module.js:302:12)
at Array.<anonymous> (module.js:430:10)
at EventEmitter._tickCallback (node.js:126:26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment