Rishabh Gupta Rishabh Gupta - 1 month ago 15
Node.js Question

please help?Now error is change cookie parser install but when i command node app it gives error cookie-parser not found

my node verson 8.3.0, npm -v 5.3.o,express

error-
module.js:491
throw err;
^

Error: Cannot find module 'cookie-Parser'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/www/html/Ideabazar/app.js:3:20)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)

Answer Source

first, you need to install cookie-parser in your console :

npm install cookie-parser

then add var cookieParser = require('cookie-parser') in your server.js file.

for ref npm doc : https://www.npmjs.com/package/cookie-parser