Skip to content

Instantly share code, notes, and snippets.

@MarshalW
Last active November 15, 2022 07:36
Show Gist options
  • Save MarshalW/a5fe9482ef0813b8ddce6ddacc68f12a to your computer and use it in GitHub Desktop.
Save MarshalW/a5fe9482ef0813b8ddce6ddacc68f12a to your computer and use it in GitHub Desktop.
Verdaccio 遇到的问题列表

Verdaccio 遇到的问题列表

npm publish 报错:one of the uplinks is down

登录后,无法 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

user xxx is not allowed to access package ahooks

执行 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment