Javascript 如何使用;节点二进制api“;在NativeScript中

Javascript 如何使用;节点二进制api“;在NativeScript中,javascript,nativescript,Javascript,Nativescript,我曾尝试在NativeScript项目中使用它,但NativeScript不支持它的某些依赖项,因此会显示错误 WARNING in ../node_modules/ws/lib/buffer-util.js Module not found: Error: Can't resolve 'bufferutil' in '/home/user/Typescript/PaperGUI/node_modules/ws/lib' @ ../node_modules/ws/lib/buffer-util

我曾尝试在NativeScript项目中使用它,但NativeScript不支持它的某些依赖项,因此会显示错误

WARNING in ../node_modules/ws/lib/buffer-util.js
Module not found: Error: Can't resolve 'bufferutil' in '/home/user/Typescript/PaperGUI/node_modules/ws/lib'
 @ ../node_modules/ws/lib/buffer-util.js
 @ ../node_modules/ws/lib/receiver.js
 @ ../node_modules/ws/index.js
 @ ../node_modules/node-binance-api/node-binance-api.js


WARNING in ../node_modules/ws/lib/validation.js
Module not found: Error: Can't resolve 'utf-8-validate' in '/home/user/Typescript/PaperGUI/node_modules/ws/lib'
 @ ../node_modules/ws/lib/validation.js
 @ ../node_modules/ws/lib/receiver.js
 @ ../node_modules/ws/index.js
 @ ../node_modules/node-binance-api/node-binance-api.js
 


ERROR in ../node_modules/socks-proxy-agent/index.js
Module not found: Error: Can't resolve 'dns' in '/home/user/Typescript/PaperGUI/node_modules/socks-proxy-agent'
 @ ../node_modules/socks-proxy-agent/index.js 7:10-24
 @ ../node_modules/node-binance-api/node-binance-api.js


ERROR in ../node_modules/debug/src/node.js
Module not found: Error: Can't resolve 'net' in '/home/user/Typescript/PaperGUI/node_modules/debug/src'
 @ ../node_modules/debug/src/node.js 193:16-30
 @ ../node_modules/debug/src/index.js
 @ ../node_modules/https-proxy-agent/index.js
 @ ../node_modules/node-binance-api/node-binance-api.js


ERROR in ../node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'tls' in '/home/user/Typescript/PaperGUI/node_modules/forever-agent'
 @ ../node_modules/forever-agent/index.js 7:10-24
 @ ../node_modules/request/request.js
 @ ../node_modules/request/index.js
 @ ../node_modules/node-binance-api/node-binance-api.js
 
这不是一个完整的错误,但由于大多数错误只是丢失模块的重复,我只在每个丢失模块中放置一个


谢谢

此库依赖于nativescript不支持的websocket,请使用binance rest api,或者您可以尝试插入nativebase websocket库并修改库代码