登录后,无法 publish package,报错为:
ERR! E503 one of the uplinks is down, refuse to publish
经测试,发现无法在 verdaccio 节点访问 https://registry.npmjs.org/
解决办法,verdaccio - config.yaml:
storage: ./storage
auth:
htpasswd:
file: ./htpasswd
uplinks:
# npmjs:
# url: https://registry.npmjs.org/
taobao:
url: https://registry.npm.taobao.org/
packages:
"@*/*":
access: $all
publish: $authenticated
proxy:
# - npmjs
- taobao
"**":
proxy:
# - npmjs
- taobao
执行 npm install 时报错:
npm install @app/server --registry http://10.2.3.4:4873
..
npm ERR! code E403
npm ERR! 403 403 Forbidden - GET http://10.2.3.4:4873/ahooks - user xxx is not allowed to access package ahooks
..
解决办法,修改 config/config.yaml:
storage: ./storage
auth:
htpasswd:
file: ./htpasswd
uplinks:
# npmjs:
# url: https://registry.npmjs.org/
taobao:
url: https://registry.npm.taobao.org/
packages:
"@*/*":
access: $all
publish: $authenticated
proxy:
# - npmjs
- taobao
"**":
access: $all # <---
proxy:
# - npmjs
- taobao