Geos-Mac:hone georgiana$ npm list
/Users/georgiana/local/hone
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
└── [email protected]
However, a simple script that contains
var express = require( 'express' ).createServer();
gives
Error: Cannot find module 'express'
at Function._resolveFilename (module.js:322:11)
.........
when trying to use express.
Please note that
Geos-Mac:hone georgiana$ npm express -v
1.0.6
and
Geos-Mac:hone georgiana$ node -v
v0.5.0-pre
Any ideas?
npminstalls modules locally. So your code needs to be near your/.node_modules/folder.> require.paths [ '/Users/georgiana/.node_modules', '/Users/georgiana/.node_libraries', '/Users/georgiana/local/hone/lib/node' ]> Geos-Mac:node_modules georgiana$ pwd/Users/georgiana/local/hone/node_modulesGeos-Mac:node_modules georgiana$ ls -lsatotal 00 drwxr-xr-x 5 georgiana staff 170 May 21 13:55 .0 drwxr-xr-x 7 georgiana staff 238 May 21 13:54 ..0 drwxr-xr-x 2 georgiana staff 68 May 21 13:55 .bin0 drwxr-xr-x 9 georgiana staff 306 May 21 01:01 gently0 drwxr-xr-x 13 georgiana staff 442 May 21 01:01 mysql/Users/georgiana/Sites/nodejs-playI executed thenpm install expresscommand, which installed the module in/Users/georgiana/Sites/nodejs-play/node_modules/express