Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Unable to install plugins via run-node-script.sh on on-prem instance (TranspilerEngine failure)

BenoîtB
Tera Contributor

Hello,

I am trying to install plugins (specifically i18n French) on an on-premise ServiceNow instance using the CLI tool `run-node-script.sh`.

Here is the script I am using:

---
var plugins = [];
plugins.push('com.snc.i18n.french');

var main = new GlideMultiPluginManagerWorker();
main.setPluginIds(plugins);
main.setProgressName("Plugin Installer I18N FR");
main.setBackground(true);
main.start();

gs.print("STATUS:WORKER_STARTED");
---

The script executes without error, but the plugin is never installed.

After investigating the logs, I noticed the following error during startup:

---
TranspilerEngine *** ERROR *** TranspilerEngine failed to initialize.
Error: no swc-jni_linux64 in java.library.path
ScriptEvaluator *** WARNING *** TranspilerEngine failed to initialize.
---

It seems that the JavaScript engine is not properly initialized, which might prevent any script execution from happening.

Additional context:
- On-premise instance
- Running via `run-node-script.sh`
- Java 17
- PostgreSQL backend
- No plugin installation logs appear
- Even simple `gs.print()` tests do not produce output

My questions:
1. Is the `run-node-script.sh` method still supported for plugin installation in recent versions?
2. Is the TranspilerEngine (SWC) required for script execution in this context?
3. Is there a way to disable the transpiler or fallback to a legacy JS engine?
4. Are there additional native libraries (like `swc-jni_linux64`) that must be manually installed in on-prem environments?

Any guidance or best practices for installing plugins via CLI on on-prem instances would be greatly appreciated.

Thanks in advance!

1 REPLY 1

Alex Coope - SN
ServiceNow Employee

Hi @BenoîtB,

So, I wouldn't typically recommend trying to install a "plugin" via a shell script (even if it's for an on-prem instance), instead you should be able to do it from within the standard "Application Manager" because a "plugin" is contained within the Platform itself (it's not like a Store App that has to be obtained separately).

With that being said, if you really wanted to install it via a script, it should be within something like a "Fix Script" to ensure it has access to the API's. I suspect the reason you're not getting success is because of how your shell script is running, it doesn't know what "gs" is, nor the API's, as they come from the Application level not the shell level.

So, in theory, you could run a "Fix Script" in the instance like this:

// install french
var pluginInstall = new GlideRecord('v_plugin');
pluginInstall.addEncodedQuery("com.glide.i18n.french"); // find french
pluginInstall.query();
while(pluginInstall.next()){
    pm.registerPlugin(pluginInstall.id); // install the plugin
    if(pluginInstall.has_demo_data == 'true'){
        pm.loadDemoData(pluginInstall.id);
    }
    gs.log("Plugin -> "+pluginInstall.id+" | "+pluginInstall.active);
}
 

^ note that there are two French language packs "French" for France, and "French Canadian" for Quebecois - this would only install "French", so if you want to install Quebecois that would be "com.glide.i18n.french_canada". The output of this log entry would be present in "Script Log Statements" because of the gs.log() call.

However, installing in this way is not the recommended approach, instead it is better to go to the "Application Manager" and install the plugin (not app) from there. On-prem instances do however need to install "Store Apps" separately which I appreciate could cause some confusion,

Many thanks,
Kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization