Install an npm package from a private registry with the ServiceNow IDE
Install Node Package Manager (npm) packages from a private registry as dependencies in your application to use them as third-party libraries.
Vorbereitungen
Role required: admin
Warum und wann dieser Vorgang ausgeführt wird
To install packages from private registries, you must configure your Package Manager user settings in the ServiceNow IDE. Then you can choose in which applications to install packages.
ServiceNow IDE uses the public npm registry (https://registry.npmjs.org) as its default package source. If your network blocks access to this registry, you must have access to an alternate registry to download packages and build applications in the ServiceNow IDE. If access to the public npm registry is blocked on your system, you must configure a private npm registry in your Package Manager user settings in the ServiceNow IDE.
Access-Control-Allow-Origin header.Prozedur
User settings for private registry access
In the following example, a user configured access to a private registry using basic authentication. The user also configured their settings to install packages from a public registry with the @example
scope.
{
"files.autoSave": "off",
"package-manager.defaultRegistry": "<private-registry-url>",
"package-manager.basicAuth": [
{
"registry": "<private-registry-url>",
"user": "<user-name>",
"pass": "<password>"
}
],
"package-manager.scopedRegistries": [
{
"scope": "@example",
"registry": "<public-registry-url>"
}
]
}
Nächste Maßnahme
Use the packages that you installed as third-party libraries in your application. For more information, see Use third-party libraries in applications in the ServiceNow IDE.