Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to install node package to API proxy behind a http_proxy

Not applicable

I'm trying to install request, response and http-proxy package to my API proxy.

but when I ran command, it returned

npm ERR! Trireme Trireme
npm ERR! argv "./node" "/opt/apigee/edge-management-server-4.17.01-0.0.967/lib/node_modules/npm/cli.js" "install" "--loglevel" "error" "--registry" "https://registry.npmjs.org/" "--cache" "/opt/apigee/var/log/edge-management-server/work/npm-cache" "--ignore-scripts" "true" "--bin-links" "false" "--json"
npm ERR! node v0.10.32
npm ERR! npm  v2.14.1
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect
npm ERR! { [Error: connect ECONNREFUSED]
npm ERR!   message: 'connect ECONNREFUSED',
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   parent: 'test' }
npm ERR! 
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Please include the following file with any support request:

And I found this

https://community.apigee.com/articles/32317/nodejs-npm-install-using-management-api-on-opdk-15.html

This help told me to change something in nodejs.properties as below:

npm.registry.uri=https://registry.npmjs.org //

max.class.cache.entries=0

After do this, I have to restart management server but it change my properties back:

[ChangeDelta, position: 57, lines: [max.class.cache.entries=0] to [max.class.cache.entries=2000]]

But I'm not sure, the file I changed was right.

So, my questions are:

1. Path of nodejs.properties is /opt/apigee/edge-management-server-4.17.01-0.0.967/conf/?

2. How to edit config and restart without changing my properties?

3. My Server is behind proxy. When I install package, how to pass the proxy?

- I used command npm to set proxy but it returned -bash: npm: command not found.

0 6 5,305
6 REPLIES 6