Chapter 2. Installing the circuit breaker add-on from the Red Hat customer registry
The circuit breaker add-on for Red Hat build of Node.js is a fully supported implementation of the open source Opossum module. Red Hat provides the circuit breaker add-on as the @redhat/opossum module. You can download and install the @redhat/opossum module from the Red Hat customer registry.
Procedure
- On the command line, access the root directory of your Node.js application.
To specify the download paths for installing Node.js modules, complete the following steps:
-
In the root directory of your application, create a file named
.npmrc. To specify the path to the Red Hat customer registry, enter the following line in the
.npmrcfile:@redhat:registry=https://npm.registry.redhat.com
@redhat:registry=https://npm.registry.redhat.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow To specify the path to the npm registry, enter the following line in the
.npmrcfile:registry=https://registry.npmjs.org
registry=https://registry.npmjs.orgCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Save the
.npmrcfile.
-
In the root directory of your application, create a file named
To download and install the
@redhat/opossummodule, enter the following command:npm install @redhat/opossum
$ npm install @redhat/opossumCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
-
If a
node_modulesdirectory already exists in your project, the@redhat/opossummodule is automatically installed in this directory. -
If a
node_modulesdirectory does not exist in your project, anode_modulessubdirectory is automatically created in the root directory of your Node.js application, and the@redhat/opossummodule is automatically installed in this subdirectory.