例如:配置淘宝源和官方源
# a list of other known repositories we can talk to
uplinks:
npmjs:
#url: https://registry.npmjs.org/
#url: https://repo.huaweicloud.com/repository/npm/
url: https://registry.npm.taobao.org/
agent_options:
keepAlive: true
maxSockets: 40
maxFreeSockets: 10
npmjs2:
url: https://registry.npmjs.org/
agent_options:
keepAlive: true
maxSockets: 40
maxFreeSockets: 10
packages:
'@*/*':
# scoped packages
access: $all
publish: $authenticated
unpublish: $authenticated
proxy: npmjs npmjs2
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $all
# allow all known users to publish/publish packages
# (anyone can register by default, remember?)
publish: $authenticated
unpublish: $authenticated
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs npmjs2