Node.js: TypeError: object is not a function

前端 未结 2 1872
无人及你
无人及你 2021-02-07 04:53

I have a weird error:

var http = require(\"http\");
var request = require(\"request\");

http.createServer(function(request, response) {
    response.writeHead(2         


        
2条回答
  •  花落未央
    2021-02-07 05:13

    You are no longer able to access the global variable 'request'. You need to rename your local variable 'request' with some other name and the problem will be resolved.

提交回复
热议问题