Node.js unhandled 'error' event

后端 未结 6 1897
广开言路
广开言路 2021-02-02 08:14

I have written a simple code and save it in file try.js .

var http = require(\'http\');
var makeRequest = function(message) {
  var options = {
    host: \'loca         


        
6条回答
  •  名媛妹妹
    2021-02-02 08:33

    change port number. Because your port is already is running.

    port number like : 8000,8001,3000,3001,8080 ....

     app.listen(3030,()=>{})
    

    (or) Kill your port number. If you are using Ubuntu OS to follow this steps.

    1. To Find PID or TCP using terminal using this command: sudo netstat -ap | grep :"port number"
    2. To Kill the process using this command: kill -9 "process_id or tcp_id"
    3. To Run your NodeJs

提交回复
热议问题