How can we use a corporate proxy to install additional nodejs modules using npm on OpenShift Enterprise?

Solution Unverified - Updated -

Issue

  • All our OpenShift Enterprise Nodes are behind a firewall and direct connection to the internet is not allowed. Is it possible that a node uses a corporate proxy to communicate with web servers to install additional nodejs modules use npm?
  • Node.js cartridge -npm configuration.
  • What is the recommended way of ensuring that the npm configuration is put in place during gear creation.
  • When do a git push to install additional nodejs modules I see Error: connect ETIMEDOUT messages:
public$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 345 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Stopping NodeJS cartridge
remote: Repairing links for 1 deployments
remote: Building git ref 'master', commit 9bba49e
remote: Building NodeJS cartridge
remote: npm info it worked if it ends with ok
remote: npm info using npm@1.2.17
remote: npm info using node@v0.10.5
remote: npm info preinstall Maze-Sample-App@0.0.1
remote: npm info trying registry request attempt 1 at 15:13:06
remote: npm http GET https://registry.npmjs.org/express
remote: npm info trying registry request attempt 1 at 15:13:06
remote: npm http GET https://registry.npmjs.org/ejs
remote: npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
remote: npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
remote: npm info trying registry request attempt 2 at 15:14:20
remote: npm http GET https://registry.npmjs.org/ejs
remote: npm info trying registry request attempt 2 at 15:14:20
remote: npm http GET https://registry.npmjs.org/express
remote: npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
remote: npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT
remote: npm info trying registry request attempt 3 at 15:16:23
remote: npm http GET https://registry.npmjs.org/express
remote: npm info trying registry request attempt 3 at 15:16:23
remote: npm http GET https://registry.npmjs.org/ejs
remote: npm ERR! Error: connect ETIMEDOUT
remote: npm ERR!     at errnoException (net.js:884:11)
remote: npm ERR!     at Object.afterConnect [as oncomplete] (net.js:875:19)
remote: npm ERR! If you need help, you may report this log at:
remote: npm ERR!     <http://github.com/isaacs/npm/issues>
remote: npm ERR! or email it to:
remote: npm ERR!     <npm-@googlegroups.com>
remote:
remote: npm ERR! System Linux 2.6.32-431.1.2.el6.x86_64
remote: npm ERR! command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install" "-d"
remote: npm ERR! cwd /var/lib/openshift/52de357e7f33c10bca000001/app-root/runtime/repo
remote: npm ERR! node -v v0.10.5
remote: npm ERR! npm -v 1.2.17
remote: npm ERR! syscall connect
remote: npm ERR! code ETIMEDOUT
remote: npm ERR! errno ETIMEDOUT
remote: npm ERR!
remote: npm ERR! Additional logging details can be found in:
remote: npm ERR!     /var/lib/openshift/52de357e7f33c10bca000001/app-root/runtime/repo/npm-debug.log
remote: npm ERR! not ok code 0
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: Failed to execute: 'control build' for /var/lib/openshift/52de357e7f33c10bca000001/nodejs
remote:
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://52de357e7f33c10bca000001@xxx.com/~/git/test.git/
   8171f10..9bba49e  master -> master

Environment

  • OpenShift Enterprise 2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.