Error: Cannot find module 'async' #2

Open
Dieterbe opened this Issue Jun 15, 2012 · 2 comments

Comments

Projects
None yet
2 participants

Hi,
I'm following the instructions, trying to get a basic test working.
I ran npm install openstack-storage with creates node_modules/openstack-storage and some extra modules like so:

14:53:01 dieter@ws vega swift ? ls -alh node_modules/openstack-storage/node_modules 
total 28K
drwxr-xr-x 7 dieter users 4.0K Jun 15 14:33 .
drwxr-xr-x 4 dieter users 4.0K Jun 15 14:33 ..
drwxr-xr-x 3 dieter users 4.0K Jun 15 14:33 async
drwxr-xr-x 4 dieter users 4.0K Jun 15 14:33 dateformat
drwxr-xr-x 5 dieter users 4.0K Jun 15 14:33 optimist
drwxr-xr-x 4 dieter users 4.0K Jun 15 14:33 request
drwxr-xr-x 6 dieter users 4.0K Jun 15 14:33 winston

the problem is then, when I follow Example usage 1 in my code (in the parent directory that holds node_modules/openstack-storage) the var async = require('async'); fails


14:50:19 dieter@ws vega swift ? coffee vega.coffee
Error: Cannot find module 'async'
    at Function._resolveFilename (module.js:337:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:359:17)
    at require (module.js:375:17)
    at Object.<anonymous> (/home/dieter/workspaces/eclipse/transcoder/vega/vega.coffee:45:11)
    at Object.<anonymous> (/home/dieter/workspaces/eclipse/transcoder/vega/vega.coffee:418:4)
    at Module._compile (module.js:446:26)
    at Object.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:79:25)
    at /usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:175:29
    at /usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:150:18

looks like, instead of what the README says, i should run:

var async = require('./node_modules/openstack-storage/node_modules/async');
var storage = require('./node_modules/openstack-storage/lib/storage');
var authenticate = require('./node_modules/openstack-storage/lib/authenticate');
Owner

mmurphy commented Jun 15, 2012

I've run the examples from within the project folder.
When run on their own, you need to "npm install" the other modules that they reference.
Thanks for pointing it out, I'll update the Readme.

mmurphy was assigned Jun 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment