Reputation: 1619
Using the latest version of Nativescript I've created a plugin as per the documentation and after running tns plugin add ../nativescript-keychain
I get the message Successfully installed plugin nativescript-keychain.
I can also see that it's been added to the node_modules directory of my app but require("nativescript-keychain")
doesn't work as I get the error Cannot find module 'nativescript-keychain'
My plugin package.json looks like
{
"name": "nativescript-keychain",
"version": "0.0.1",
"nativescript": {
"platforms": {
"ios": "2.2.1"
}
}
}
Upvotes: 4
Views: 3038
Reputation: 5399
There are several reasons why this might occur; it would be helpful if you provided a repo to see all the code.
main: "somefile"
key.tns run ios --emulator
after you installed the plugin, you have to rebuild the app before it will take effect, plugins can't be synced via livesync...Upvotes: 2