Running node.js code just displays a node identifier

前端 未结 9 2188
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-19 19:07

I have the following code in a file called server.js.

var http = require(\'http\');

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


        
9条回答
  •  -上瘾入骨i
    2021-02-19 19:45

    I was also running with same issue - while defining the path for windows use below parameter

    Windows:

    set NODE_PATH=C:\nodejs
    

    OR

    Set the environment variable for nodejs

    NODE_PATH=C:\nodejs
    Path= C:\nodejs
    

    (append the path contain this string “c:\nodejs”)

提交回复
热议问题