File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ const npm = require('../npm')
44const needsAuthError = ( msg ) =>
55 Object . assign ( new Error ( msg ) , { code : 'ENEEDAUTH' } )
66
7- module . exports = async ( opts = { } , spec = null ) => {
7+ module . exports = async ( opts = { } ) => {
88 const { registry } = opts
99 if ( ! registry ) {
10- throw new Error ( 'no default registry set' )
10+ throw Object . assign ( new Error ( 'No registry specified.' ) , { code : 'ENOREGISTRY' } )
1111 }
1212
1313 // First, check if we have a user/pass-based auth
@@ -20,8 +20,7 @@ module.exports = async (opts = {}, spec = null) => {
2020 } else if ( token ) {
2121 // No username, but we have a token; fetch the username from registry
2222 const registryData = await npmFetch . json ( '/-/whoami' , {
23- ...opts ,
24- spec
23+ ...opts
2524 } )
2625 const { username : usernameFromRegistry } = registryData
2726 // Retrieved username from registry; return it
You can’t perform that action at this time.
0 commit comments