osx - Trouble with node-mongoskin on OS X 10.8 -


i had install module mongoskin (sudo npm install mongoskin -g) - success install.

when try start index.js (supervisor index.js), there's error:

module.js:340 throw err; ^ error: cannot find module 'mongoskin' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object. (/users/smithua/documents/uezo.pro/dnode-node/im.js:5:13) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) debug: program node index.js exited code 8 

ls -la /usr/local/lib/node_modules/:

0 drwxr-xr-x  14 smithua  staff  476 jul 30 18:53 dnode 0 drwxr-xr-x   7 smithua  staff  238 jul 31 11:40 jshint 0 drwxr-xr-x  10 smithua  staff  340 jul 31 11:00 jslint 0 drwxr-xr-x  17 smithua  staff  578 aug 12 16:48 mongoskin 0 drwxr-xr-x  15 smithua  staff  510 jul 30 16:40 mysql 0 drwxr-xr-x  20 smithua  staff  680 jul 31 11:09 npm 0 drwxr-xr-x  19 smithua  staff  646 jul 31 03:56 promised-io 0 drwxr-xr-x   6 smithua  staff  204 jul 30 16:40 supervisor 

you have install module locally, not globally. means must not use -g option when installing using npm.

in node.js, each application needs have of dependencies in local node_modules folder. achieve installing node-mongoskin using:

$ npm install mongoskin 

global installation provide system-wide binaries, such debugger, testing tool or bootstrapper of express. means, when install module globally, can call binaries everywhere in system, application work need install locally.

for applications, globally installed modules not matter @ (and that's ls command shows: globally installed modules).

hope helps.

ps: please note distinction between local , global installs related module, not mongoskin.

pps: might want check out package.json file, can put dependencies into, can automatically install them @ once using simple npm install. interactively create such package.json file, see npm init command.

ppps: please see answer on getting error while using express node.js, may further understand about.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -