简体   繁体   English

节点未运行,WebSocket错误

[英]node not running , websocket error

I'm getting an error when I try to run my node.I have installed ws and websocket, but seems that none is working 尝试运行节点时出现错误,我已经安装了ws和websocket,但是似乎没有任何作用

错误图片

Simply replace 'const' by 'var'. 只需将“ const”替换为“ var”即可。 Strict mode forces you to declare your variables explicitely. 严格模式强制您明确声明变量。

Most likely what is happening is that you are executing your script with an older version of node (more specifically V8) that had restrictions on how/where some ES6 features could be used. 最有可能发生的事情是,您正在使用较旧版本的节点(更具体地说是V8)执行脚本,该节点对某些ES6功能的使用方式/位置有所限制。 Upgrading node ( at least to v4.0.0) should fix the problem. 升级节点( 至少升级到v4.0.0)应该可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM