简体   繁体   中英

I cannot download packages from npm or bower

I worked with npm and bower with my mobile internet connection without any issues, then I connected to my university proxy and changed the proxy in configuration ( npm config set proxy ), then again I came back to use my own mobile internet and chaged the proxy value to null. But now I cannot download any packages using npm or bower.

My userconfig file (~/.npmrc)

;;;;
; npm userconfig file
; this is a simple ini-formatted file
; lines that start with semi-colons are comments.
; read `npm help config` for help on the various options
;;;;


;;;;
; all options with default values
;;;;
; access=null
; always-auth=false
; also=null
; bin-links=true
; browser=null
; ca=null
; cafile=undefined
; cache=/home/charlesrajendran-/.npm
; cache-lock-stale=60000
; cache-lock-retries=10
; cache-lock-wait=10000
; cache-max=null
; cache-min=10
; cert=null
; color=true
; depth=null
; description=true
; dev=false
; dry-run=false
; editor=vi
; engine-strict=false
; force=false
; fetch-retries=2
; fetch-retry-factor=10
; fetch-retry-mintimeout=10000
; fetch-retry-maxtimeout=60000
; git=git
; git-tag-version=true
; global=false
; globalconfig=/usr/local/etc/npmrc
; global-style=false
; group=1000
; heading=npm
; if-present=false
; ignore-scripts=false
; init-module=/home/charlesrajendran-/.npm-init.js
; init-author-name=
; init-author-email=
; init-author-url=
; init-version=1.0.0
; init-license=ISC
; json=false
; key=null
; legacy-bundling=false
; link=false
; local-address=undefined
; loglevel=warn
; long=false
; message=%s
; node-version=4.2.6
; npat=false
; onload-script=null
; only=null
; optional=true
; parseable=false
; prefix=/usr
; production=false
; progress=true
; proprietary-attribs=true
; proxy=null
; https-proxy=null
; user-agent=npm/{npm-version} node/{node-version} {platform} {arch}
; rebuild-bundle=true
; registry=https://registry.npmjs.org/
; rollback=true
; save=false
; save-bundle=false
; save-dev=false
; save-exact=false
; save-optional=false
; save-prefix=^
; scope=
; searchopts=
; searchexclude=null
; searchsort=name
; shell=/bin/bash
; shrinkwrap=true
; sign-git-tag=false
; strict-ssl=true
; tag=latest
; tag-version-prefix=v
; tmp=/tmp
; unicode=true
; unsafe-perm=true
; usage=false
; user=0
; userconfig=/home/charlesrajendran-/.npmrc
; umask=2
; version=false
; versions=false
; viewer=man
; _exit=true
; globalignorefile=/usr/local/etc/npmignore

There is no problem with npm or bower the issue I had was with system proxy. So we need to unset the http_proxy and https_proxy to get this working.

What i did is:

unset http_proxy
unset https_proxy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM