运行node时遇到下述提示:

events.js:160  throw er; // Unhandled 'error' event或者events.js:160       throw er; // Unhandled 'error' event       ^  Error: listen EADDRNOTAVAIL 172.16.1.228:3003。

本来程序运行的好好的,有一次启动时提示我们上面的信息,经从网上查找答案是:此端口已被占用,改换其他端口。然后是一系列解决方案。

下面说说我遇到这个问题是怎样解决:

1、我换了端口,没有效果,依旧有上述提示。

2、查看当前被端口占用的进程,没的找到。

3、监听函数所有参数已写完整。ip地址是我本地ip地址。实在纳闷,到底是哪里出了差错。

4、从stactoverflow中查找到答案说让重新安装整个node_modules文件夹下的node,我看了后果断放弃,我里面用到了很多包,重新搭的话还不知道遇到什么问题。

5、无奈之下把程序中监听地址中的本机ip换成了127.0.0.1。靠!居然成功。我纳闷,这是在逗我吗?然后果断看了看电脑上的本地ip,再次傻住,我去!我本地电脑ip已变,你怎么说变就变了!好吧,原来如此,把程序中ip地址改成127.0.0.1最靠谱。

运行node提示:events.js:160 throw er; // Unhandled 'error' event的更多相关文章

  1. npm run dev报错,events.js:160 throw er; // Unhandled 'error' event

    错误代码如下: vue-project@1.0.0 dev E:MySoftwaretestGitwebpackvue-projectnode build/dev-server.js "80 ...

  2. npm run dev时报错“events.js:160 throw er; // Unhandled 'error' event”

    经查,此问题由端口占用导致,node服务器默认端口8080已被其他程序占用,关闭占用端口的程序或者修改node服务器的默认端口即可解决此问题

  3. vue项目npm run dev报错events.js:160 throw er; // Unhandled 'error' event listen EADDRINUSE :::8002

    出错情况,如下图: 报错原因: listen EADDRINUSE :::8002 意思是当前8002端口被占用 解决办法: 一:简单粗暴:关掉可能影响的相关程序,重新执行启动. 二: 1.Win+R ...

  4. nodejs报错 events.js:72 throw er; // Unhandled 'error' event

    var http = require('http'); var handlerRequest = function(req,res){ res.end('hello');}; var webServe ...

  5. browser-sync events.js:85 throw er; // Unhandled 'error' event

    browser-sync运行的时候提示如下错误,这个是因为browser-sync 配置的端口被占用的原因. events.js:85 throw er; // Unhandled 'error' e ...

  6. events.js:72 throw er; // Unhandled 'error' event

    http://stackoverflow.com/questions/24525253/events-js72-throw-er-unhandled-error-event 出现了一个上述的错误. e ...

  7. 运行npm run watch时报:events.js:182 throw er; // Unhandled 'error' event

    I had this issue i did the following steps and i have no issues anymore: Delete node_modules directo ...

  8. 错误码:events.js:183 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE :::8081

    错误的产生: 错误的原因: 端口被占用 修改访问端口就可以了 https://blog.csdn.net/qq_25479327/article/details/79824742

  9. vue init初始化项目后 npm run dev报错 10% building modules 1/1 modules 0 activeevents.js:182 throw er; // Unhandled 'error' event

    报错信息: 10% building modules 1/1 modules 0 activeevents.js:182       throw er; // Unhandled 'error' ev ...

随机推荐

  1. linux 进程学习笔记-暂停进程

    <!--[if !supportLists]-->Ÿ <!--[endif]-->暂停进程 int pause() 其会挂起当前进程直到有信号来唤醒或者进程被结束. 随便提一下 ...

  2. 运算符-----------instanceof

  3. Highcharts小数保留两位方法

    tooltip: { valueSuffix: '%', formatter:function(){ return''+this.series.name+' '+Highcharts.numberFo ...

  4. 【Lintcode】033.N-Queens

    题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two que ...

  5. bzoj 2159 Crash 的文明世界 & hdu 4625 JZPTREE —— 第二类斯特林数+树形DP

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2159 使用公式:\( n^{k} = \sum\limits_{i=0}^{k} S(k,i ...

  6. Python 中的 classmethod 和 staticmethod 有什么具体用途?

    作者:李保银链接:https://www.zhihu.com/question/20021164/answer/18224953来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明 ...

  7. TextBox的OnTextboxChanged事件里对Text重新赋值带中文, 导致崩溃

    今天遇到一个超级bug, Textbox做了限制, 只能输入数字. 结果在搜狗输入法输入中文时导致崩溃, 出错信息如下: 未处理 System.InvalidOperationException   ...

  8. Logstash-安装logstash-filter-multiline插件(解决logstash匹配多行日志)

    ELK-logstash在搬运日志的时候会出现多行日志,普通的搬运会造成保存到ES中日志一条一条的保存,很丑,而且不方便读取,logstash-filter-multiline可以解决该问题. 接下来 ...

  9. 反射-Class

    package classes; public class ClassDemo1 { public static void main(String[] args){ Foo foo1 = new Fo ...

  10. win10 ObservableCollection 排序自动收缩问题

    ObservableCollection本身是没有排序Sort功能的,不过我们可以通过冒泡排序来实现,以下是扩展功能: public static void Sort<T>(this Ob ...