     catch error
       return callback("Error parsing package.json file: #{error.message}")
 
-    if version = options.argv._[0]
+    if version?.length > 0
       @registerPackage pack, (error, firstTimePublishing) =>
         return callback(error) if error?
 

              if firstTimePublishing and not error?
                @logFirstTimePublishMessage(pack)
              callback(error)
    else if tag = options.argv.tag
      @registerPackage pack, (error, firstTimePublishing) =>
        return callback(error) if error?


  run: (options) ->
    {callback} = options
    options = @parseOptions(options.commandArgs)
    tag = options.argv.tag
    [version] = options.argv._

    metadataPath = path.resolve('package.json')
    unless fs.isFileSync(metadataPath)
