0

I am developing Node.JS app in Visual Studio (2015) with Node.JS tools and I installed NPM package mongodb. But when I want to require mongodb module, it fails with error

Cannot find module 'mongodb'

In solution explorer > project > npm is this package shown´. Why it throws error? TypeScript Code for loading module is

import mongo = require('mongodb');
// converted to JS
var mongo = require('mongodb');

package.json:

{
  "name": "XYZ",
  "version": "0.0.0",
  "description": "_XYZ",
  "main": "app.js",
  "author": {
    "name": "zurmi",
    "email": "fsdgsdfgsdf@sadfasdf.sd"
  },
  "dependencies": {
    "mongodb": "2.0.47"
  }
}

Solution explorer shows mongodb package

Misaz
  • 3,694
  • 2
  • 26
  • 42
  • One possible solution to your problem has been discussed in this [thread](http://stackoverflow.com/questions/14226410/node-js-cannot-find-module-mongodb) – hecnabae Nov 04 '15 at 14:44
  • I have read it. It is not working. When I install package globaly, it does not work too. – Misaz Nov 04 '15 at 20:32

0 Answers0