Skip to content

Package Management

Priya Angara edited this page Dec 15, 2017 · 18 revisions

Project dependencies need to get updated from time to time. Here are some helpful tips if you're planning to take up this daunting task. Note: Upgrading the entire package.json to the latest versions in one go is not a good idea as it breaks a lot of things. A better approach is to do a slow roll-out. Update packages in chunks of ~5 at a time so that it is easier to localize the source of the error.

package.json

  • Dependencies required by the application are referenced here
  • Dependencies are installed in the node_modules/ folder
  • Run yarn install to install all the dependencies
  • [Optional] Clean out node_modules/ before running yarn install if you see errors

bower.json

  • Dependencies required by the front-end are referenced here
  • Dependencies are installed in the public/lib/ folder
  • Run bower install to install all the dependencies
  • [Optional] Clean out public/lib/ before running bower install if you see errors

node, npm and yarn versions

  • Make sure you have the same versions of node/yarn as dev/test/prod ** Go to the openshift console, look for the project > terminal ** Run node -v, yarn -version (also npm -version in case you're using npm) to figure out the current version being used.

Upgrading versions in package.json

Look out for these packages

  1. csv-parse
  2. All grunt-* packages
  3. nodemailer
  4. multer

Upgrading these packages on local might not give you errors but fails when Jenkins triggers a build.

Exiting "Trigger OpenShift Build" unsuccessfully; build "mem-mmt-build-x" did not complete successfully within the configured timeout of "1200000" ms; last reported status:  [Failed].

error: build error: non-zero (13) exit code from registry.access.redhat.com

Errors that look like this usually mean jenkins did not like some package(s), the details of which we never get to know. Therefore, do this.

Upgrading versions in bower.json

npm -> yarn

bower -> yarn (TODO)

Clone this wiki locally