Vincent Duprez
Vincent Duprez

Reputation: 3892

How to add npm modules in telerik nativescript app

I'd like to use the telerik platform as my primary development platform for mobile dev but I'm facing an issue when trying out a sample app on physical hardware.

Using telerik platform with a nativescript angular2 app . I succeed into running the app on the telerik app on iPhone, even if the 'setting up livesync' takes forever and does not work in the end, maybe there's something I dont't get about it, but anyway, I use the 3 fingers shortcut to reload changes.

When I try to load npm modules : I get how to import them in telerik platform. I do it in the code section, then inside the properties, in the 'Dependencies' tab, there I choose Install from Plugins Marketplace, choosing NPM, I install whatever module.

I tried to install moment, this worked just fine, then I tried to install other npm modules ( nativescript-socketio and nativescript-socket.io) but the launch on the iPhone always fails with the red screen of death and a message telling it is unable to find the required files.

I found out that there is a plugin list on the Telerik iPhone app (under Help & About -> NativeScript ->Plugins ) where moment is listed and not the other plugins... So how do I try my app with other plugins? is there a way to import the node_modules?

Upvotes: 0

Views: 93

Answers (1)

Marek Maszay
Marek Maszay

Reputation: 1557

Node/npm modules should work as long as they not depend on npm if its some javascript code for example email validation u can install with npm install <name of plugin> and after adding plugin u need to use tns run android/ios as livesync not update node_modules folder for use inside of app

Upvotes: 2

Related Questions