Third-party plug-in installation and upgrade
If you get a third-party plug-in package, usually import it into the storage/plugins of the target application, then restart the application, and then continue to enable or verify whether the plug-in takes effect.
Quick index
Confirm the target environment first
If you manage multiple applications locally, first switch to the target env and then operate:
Use nb plugin import to import the plug-in package
nb plugin import supports three types of sources: remote compressed packages, local compressed packages, and npm package names. This command is only responsible for importing the plug-in into storage/plugins, and will not automatically enable the plug-in.
If you have obtained the download address of the plug-in package, the local file path, or the plug-in has been published to npm, you can execute:
If you are using a private npm source, usually log in first and then specify the registry:
Specify storage path to import
If you already know the storage root directory of the target application, you can also pass --storage-path directly without relying on the current env:
The CLI will write the plugin to <storage-path>/plugins. At this time, you may not execute nb env use first, or pass --env.
Restart after importing
After the import is completed, restart the target application:
If you do not switch the current env first, you can also explicitly pass -e <env> in the command.
Enable or verify after restarting
If this is the first installation, restart and then enable the plugin:
The installation will be completed automatically when enabled for the first time.
What to do when upgrading plugins
If the plug-in is already enabled and you just switch to a new version this time, there are usually only two steps:
The same applies if you import an npm package:
In other words, the upgrade scenario does not require additional execution of nb plugin enable. Just import the new package and restart the application.
When the Internet cannot be connected directly
If the target machine cannot directly access the plug-in download address, you can first upload the .tgz file to any directory on the target machine, and then perform local import on the target machine.
for example:
There is no need to manually extract to storage/plugins here. nb plugin import will automatically put the plug-in in the correct directory.

