Can't run this nodejs code?

后端 未结 2 1138
感情败类
感情败类 2021-01-14 05:47

Im trying to run this simple code but I m getting error all the time...I really dont know what\'s the problem. It seems to me very Ok...? Thanks!

    var htt         


        
相关标签:
2条回答
  • 2021-01-14 05:58

    In your first line there are quotes missing around http:

    var http = require('http');
    
    0 讨论(0)
  • 2021-01-14 06:07

    In my case, I had

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

    As soon as I deleted the the http line, it worked for me.So, i did leave only

    var path= require('path');

    I was working on express,mongodb,socket.io.

    0 讨论(0)
提交回复
热议问题