When username and password are configured in the .npmrc for the respective scope, use basic auth when getting package metadata from the npm registry. Closes #6206