ricky162 ricky162 - 6 months ago 79
Node.js Question

What does this error mean and how do I fix it? Error: Cannot find module 'html'

I've been at this for hours and can't seem to figure out how to get it to work.
Here is the error I am getting when I run node dNode.js

Error: Cannot find module 'html'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/ricky/LA/dNode.js:3:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)


Here is what a portion of my code looks like

var express = require('express');
var mysql = require('mysql');
var html = require('html');
var bodyParser = require('body-parser');

var app = express();
app.use(bodyParser.urlencoded({extended: false}));
var handlebars = require('express-handlebars').create({defaultLayout: 'main'});
app.use(bodyParser.json());
app.engine('handlebars', handlebars.engine);
app.set('view engine', 'handlebars');
app.set('port', 3000);
app.use(express.static(__dirname + '/public'));

Answer

Try removing var html = require('html');

Comments