Upgrade Process
Overview
The process for upgrading is very similar to installing for the first time (see Installation Process). The upgrade is initiated from a shell command line, and because a config.js file is already present, the completion script reuses the existing configuration values instead of prompting for them.
End the instance before upgrading, and review the applicable guide under Migrating to a New Major Release if you are moving between major releases.
Opening a Shell
On IBM i, this is done using a PASE shell (not QShell). The best way to use a PASE shell is to connect to your IBM i server via SSH using a Unix-style terminal emulator, such as PuTTY or Git Bash for Windows. This provides a friendlier interface for working with Node.js and other Unix-style commands on the command line. For more information on configuring SSH, see https://wiki.midrange.com/index.php/SSH. Alternatively, you can start a PASE shell from a TN5250 session by running the command CALL QP2TERM.
Next, use the cd (change directory) command to go to your Profound.js installation directory. The commands below are all run from there.
Checking the Current and Available Versions
To display the current Profound.js version:
npm list profoundjsTo see which versions of Profound.js are available, visit https://www.npmjs.com/package/profoundjs, or list the available npm tags:
npm view profoundjs dist-tagsRunning the Upgrade
To upgrade Profound.js, or to reinstall it, use the following commands. Replace <tag_name> with the npm tag for the release you want (see Installation Process for the tag list):
npm install profoundjs@<tag_name>
node complete_install.jscomplete_install.js must be run after every npm install in this directory – not only during a first-time installation, and not only when Profound.js itself was the package being installed.
npm updates the Node.js components. This script is what installs and updates the IBM i Connector library to match. If the two are left at different versions, requests from IBM i fail with Version Mismatch (PJS0014).
Both commands are required. Running only npm install upgrades the Node.js components and leaves the IBM i Connector library at the previous version.
Keeping the Version From Drifting
Installing by tag records Profound.js in package.json as a caret range such as "profoundjs": "^7.33.0", which floats to the newest matching release on any later npm install. To upgrade to an exact version that will not drift afterwards:
npm install --save-exact profoundjs@7.33.0
node complete_install.jsFor the full set of options, including the silent-mode arguments used by automated pipelines, see complete_install.js Command Reference.
Installing New Sample Code
New example code is sometimes added to the installation. Sample code is not refreshed automatically during an upgrade; to install any newly available example code, add the --installSamples switch:
node complete_install.js --installSamplesTo be prompted for new configuration values during an upgrade instead of reusing the existing ones, run node complete_install.js --configure.
If the Upgrade Fails
If npm reports package errors during the upgrade – for example a corrupted node_modules directory – see Upgrading and Clearing NPM Packages and package-lock.json.