mongoose console returns undefined

Problem

i've installed mongoose using `projectFolder$ npm install mongoose'

i have no issue with mongo console but when i entered the following commands

projectFolder$ node

>

>var mongoose = require('mongoose');

undefined

i have no issue starting node server, and mongo server as i could start up my website no issue. I ran into trouble just when i try the above commands in the console. i confirmed that mongoose is installed and the cursor returned undefined.

Problem courtesy of: bouncingHippo

Solution

Checks for node_modules/mongoose folder in your project If not, try it again:

npm install mongoose

EDIT: I removed var and works it

Solution courtesy of: eseceve

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.