How can I use 1.4.5 with {N}


I have installed the library via "npm install"
When I import the library I got some errors about “Failed to find module ‘’”

I tried following both method.

import * as socket from ''; //can not find module, vscode crying about it

var socket = require(''); //  exception "failed to find module"

I was using this plugin but i need removeListener method and i was not able to achieve via this plugin.


Short answer - you can’t use the npm package, it has desktop implementation, while nativescript-socketio uses the platform-specific implementations and unifies them under a common API, so I’d suggest you make a PR to nativescript-socketio to augment it with whatever additional functionalities you need exported.

Sharing is caring!


Are you sure? What about this ? and this


The npm package is sufficient to establish connection between node backends, or a backend and a browser, but it does not have the necessary understanding to issue instructions to the android device to send/listen for messages.

It is also why has a native Android plugin, and a iOS Pod - simple ports of the JavaScript library.


@samed i will add the removeListener soon feel free to create an issue