I created a small html form with nodesjs as backend but cannot submit form getting this error
Error: Cannot find module 'html'
Require stack:
- D:\web\smallmongoproject\node_modules\express\lib\view.js
- D:\web\smallmongoproject\node_modules\express\lib\application.js
- D:\web\smallmongoproject\node_modules\express\lib\express.js
- D:\web\smallmongoproject\node_modules\express\index.js
- D:\web\smallmongoproject\app.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at new View (D:\web\smallmongoproject\node_modules\express\lib\view.js:81:14)
at Function.render (D:\web\smallmongoproject\node_modules\express\lib\application.js:587:12)
at ServerResponse.render (D:\web\smallmongoproject\node_modules\express\lib\response.js:1039:7)
at D:\web\smallmongoproject\app.js:41:7
at Layer.handle [as handle_request] (D:\web\smallmongoproject\node_modules\express\lib\router\layer.js:95:5)
at next (D:\web\smallmongoproject\node_modules\express\lib\router\route.js:144:13)
After submitting form it is supposed to entry the data in mongodb and render the same form again. but instead i am getting this error after submitting the form so it is rendering for the first time only.
CodePudding user response:
Try running npm i html
in your shell. This should install the html module dependency.