Alok Jha
Alok Jha

Reputation: 363

How to re-install a npm dependency in Openshift Nodejs app?

My nodejs app is working fine locally but failing on OpenShift with error "Cannot call method 'get' of undefined" at below line:

var express = require('express');
var controller = require('./api.controller');

var router = express.Router();
router.get('/', controller.index); // throws exception

Investigating the issue further, it seems version of Express is too old on my OpenShift app and I need to uninstall and install Express dependency. Could not find any docs on OpenShift to uninstall and install a dependency from a nodejs app?

Any help is highly appreciated.

Upvotes: 0

Views: 280

Answers (1)

Artem Bozhko
Artem Bozhko

Reputation: 1854

After you push sources to openshift, it's automatically updates all packages according to dependencies listed in the package.json file. You should be sure that package.json contains all necessary dependencies.

Upvotes: 1

Related Questions