1

I'm getting the error while installing the plugin. TypeError: Invalid Version: 1.?2.0

I've created the plugin for NativeScript. Here is how my package.json looks like.

    {
      "name": "nativescript-toaster",
      "version": "1.0.1",
      "main": "index.js",
      "nativescript": {
        "platforms": {
          "android": "1.​2.0"
        }
      }
    }

As described in some forums I've tried to remove the android entries from package.json of NS projects, and clean cache npm cache clean. But as I add android platform tns platform add android it comes again.

Please share if you've any idea about this.

Thanks Guys

1 Answers1

0

I was getting the same error. In my case, I was trying to include iOS and Android native code; I tried changing it like this: "1.3.0" , and the error disappeared.

  • What did you change to "1.3.0" ? "android" or "version" or something else? Please edit your answer to include this information. – Jonathan Mar 22 '19 at 01:18
  • I changed the value to 1.3.0, so it ended up like : { "name": "my-plugin", "version": "0.0.1", "nativescript": { "platforms": { "ios": "1.3.0", "android": "1.3.0" } } } Also, I found a working example that used : "nativescript": { "platforms": { "android": "3.0.0", "ios": "3.0.0" } }, – murillo.cjr Mar 27 '19 at 19:57
  • Awesome, could you please edit your answer to include that information? – Jonathan Mar 27 '19 at 20:06
  • Just to add to my prior comment: the example where "3.0.0" is used can be found at [link](https://docs.nativescript.org/plugins/ui-plugin-custom) – murillo.cjr Mar 27 '19 at 21:50