下载了完整webrtc代码后,node.js 报错,代码在同事机上能跑,我机子报错
PHP中文网
PHP中文网 2017-04-17 16:02:53
0
1
572

在 github上下载了别人的完整代码后,运行服务器,总是报错
const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);

                   ^

TypeError: this is not a typed array.

at Function.from (native)
at Object.<anonymous> (e:\work\untitled\自我学习\webRtc 实例(IM 通讯)\websocket\Nodejs-Websocket\node_modules\ws\lib\PerMessageDeflate.js:8:24)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (e:\work\untitled\自我学习\webRtc 实例(IM 通讯)\websocket\Nodejs-Websocket\node_modules\ws\lib\WebSocket.js:16:27)
at Module._compile (module.js:409:26)

Process finished with exit code 1

求问,如何解决这个问题,

PS:代码在同事机子能跑,我机子失败,我是Win10, 他Win7 但是我不觉得是这个原因

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
黄舟

Buffer.from() This method was introduced in node 6.0. Websocke uses this method so. The solution is to upgrade the local nodejs version to 6.0+

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template