npm express “hello world” middleware error

后端 未结 4 1194

node --version v0.10.26

npm --version 1.4.3

I followed this: http://expressjs.com/guide.html

which has this code

    var express = re         


        
4条回答
  •  渐次进展
    2021-01-04 15:42

    I faced the same problem. I ran the below from the directory where my node js file was

    npm install --save morgan
    

    Using above command adds the dependency to your package.json.

    Once package added, logger can now be used as

    logger = require('morgan');
    app.use(logger('dev'));
    

提交回复
热议问题