I\'m getting the error while running the following code in Node.js
var assert = require(\'assert\');
var request = require(\'request\');
var index = require(\'./
I ran into the same problem while trying to follow a Nodejs tutorial by w3schools. I copied the following code from them:
exports.myDateTime = function () {
return Date();
};
That, however, wouldn't work for me. What resolved the problem for me was adding module.
before the exports keyword like this:
module.exports.myDateTime = function () {
return Date();
};