Re: node.js mongodb windows platform, require("mongodb") fails

24 views
Skip to first unread message

Gianfranco

unread,
Sep 24, 2012, 5:51:17 AM9/24/12
to mongod...@googlegroups.com
This is more a npm / node problem but it depends where you install the packages.

If you install with the -g option, it will be place them in the system path, instead of the current project.
npm install -g mongodb

Check if that package is installed with:
npm list
and with -g if in the global directory

Otherwise specify the directory where the package is installed:
var mongodb = require("./mongodb");

See more info in the documentation page:

Lastly you can try:
npm link jade

On Saturday, September 22, 2012 7:30:28 PM UTC+1, gd52 wrote:
In the project directory for my application,at the command prompt I did
npm install mongodb
The messages indicated that it installed ok.

In my test program I add the line:
var mongodb = require("mongodb");
The application aborted with a message saying it could not find "mongodb".

I also tried with mongoskin, getting the same result.

When I installed "express and added the following line":
var express = require("express");
it worked fine.

What is going wrong?
Please remember that this is the windows platform.
Reply all
Reply to author
Forward
0 new messages