DevTech101

DevTech101
1 Star2 Stars3 Stars4 Stars5 Stars (17 votes, average: 2.88 out of 5)
Loading...
Below you will find, how to set a proxy for Node/NPM by using an .npmrc file. cat .npmrc
proxy=http://user:passsword@host.domain.com:8080/
https-proxy=http://user:passsword@host.domain.com:8080/
strict-ssl=false
registry=http://registry.npmjs.org/

To make node js or npm work behind a firewall

To get node compiled on Solaris check out the link below.

http://www.petertribble.co.uk/Solaris/node.html

Note: after pkgadd, move Node to node. also modify this file /opt/node/lib/node_modules/npm/bin/npm-cli.js

If you need to disable strict ssl use

npm config set strict-ssl false

Set the registry to non HTTPS

npm config set registry http://registry.npmjs.org/

Verfy with npm config list

Then to install

npm --proxy http://username:password@proxy.doamin.com:8080 install packagename

Or by setting the proxy and then install

npm config set proxy http://user:pass@your-domain.com:8080/
npm config set http-proxy http://usr:pass@your-domain.com:8080/
npm config set https-proxy http://user:pass@your-domain.com:8080/

npm install expres

npm and bower

cat /root/.bowerrc

{
    “registry”: “http://bower.herokuapp.com”,
    “strict-ssl”: false,
    “proxy”:”http://user:password@your-domain.com:8080/”,
    “https-proxy”:””
}

git proxy and certficate or self sign issues

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
  • change proxyuser to your proxy user
  • change proxypwd to your proxy password
  • change proxy.server.com to the URL of your proxy server
  • change 8080 to the proxy port configured on your proxy server
git config --global --unset http.proxy
git config --global --unset https.proxy

If you have issues with self sign, try one of the below

git config --global http.sslverify "false"

or if you like to add a ca certificate

git config –global http.sslcainfo /bin/certificate.crt

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: