Trying to do something incredibly basic, but running into a snag.
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/jetbrains');
var Product = mongoose.model('Product', {name: String});
var product = new Product({name: "WebStorm"});
product.save(function(err) {
if(err){
console.log('failed');
}else{
console.log('saved');
}
});
Continually getting ReferenceError: require is not defined at [file path].
I'm doing this in Webstorm 10. Trying to folow this tutorial on MEAN development in Webstorm. https://www.youtube.com/watch?v=JnMvok0Yks8
Ideas?