mongoose console returns undefined

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.

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

npm install mongoose

EDIT: I removed var and works it