user3052997
user3052997

Reputation: 91

Installing mongoose on node "require" undefined

I'm using mongodb, no matter how install node and mongoose on ubuntu I can't get it to work. I always get the "require" not defined error

npm install mongoose also tried npm install -g and tried putting everything in one folder mkdir node

Screenshot to show mongoose intalled in the node_modules

                    https://gamerholic/images/screenshot/mongoose.png test page where mongoose tries to connect 
   https://gamerholic/indexTest.php

'require' not defined message comes up

Upvotes: 0

Views: 146

Answers (2)

Tim Brown
Tim Brown

Reputation: 3241

If you want to do a browser require (albeit a bit oddly) you can check out http://requirejs.org/

Upvotes: 0

Morgan ARR Allen
Morgan ARR Allen

Reputation: 10678

Mongoose is meant to run from Node not in the browser.

Upvotes: 1

Related Questions