1

I am trying to build a plugin around a native iOS/Android SDK. I would like to know to finally generate a my-plugin.tgz file so that I can use it locally without publishing it. I have done this with Nativescript 6.x, but I would like to know how to do this with the new workflow in Nativescript 7.x.

Thank You.

Jubin Jose
  • 33
  • 3

2 Answers2

0

After running the build command from npm start, you will get a dist directory with a structure like this

dist
  |- packages
        |- your-plugin-name

cd into the packages directory and run npm pack your-plugin-name and you should get the .tgz file in the same directory which you can use in locally

William Juan
  • 1,395
  • 1
  • 7
  • 10
  • I am getting an error while doing this: npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/nativescript-myplugin - Not found npm ERR! 404 npm ERR! 404 'nativescript-myplugin@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. – Jubin Jose Sep 07 '21 at 19:28
0

The latest seed has the following instructions

Publish to NPM When you have everything ready to publish: Bump the version number in src/package.json Go to publish and execute publish.sh (run chmod +x *.sh if the file isn't executable) If you just want to create a package, go to publish folder and execute pack.sh. The package will be created in publish/package folder.

https://github.com/NativeScript/nativescript-plugin-seed#publish-to-npm

Ben Morris
  • 282
  • 3
  • 13