You appear to be trying to use jQuery in node.
The solution you have linked to is a solution for front-end.
Use require()
in node.
Try reading this article: Node.js, Require and Exports. It explains that for instance if you define this in one file called user.js
:
var User = function(name, email) {
this.name = name;
this.email = email;
};
module.exports = User;
You can do this in another:
var user = require('./user');
var u = new user.User();