use http proxy node.js code example
Example 1: how to run node js with proxy
$ npm config set proxy http://localhost:3128
$ npm config set https-proxy http://localhost:3128
Example 2: how to run node js with proxy
$ npm config delete http-proxy
$ npm config delete https-proxy