现在错误是更改 cookie 解析器安装但是当我命令节点应用程序时它给出错误 "cookie-parser not found"

Now error is change cookie parser install but when I command node app it gives error "cookie-parser not found"

我的节点版本 8.3.0,npm -v 5.3.0,Express。

错误

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)

模块名称错误。尝试 require cookie-parser 而不是 cookie-Parser:

var cookieParser = require('cookie-parser')

首先,您需要在控制台中安装 cookie-parser:

npm install cookie-parser

然后在您的 server.js 文件中添加 var cookieParser = require('cookie-parser')

参考 npm 文档:https://www.npmjs.com/package/cookie-parser