         packagePaths[packageName] = fs.realpathSync(packagePath)
 
     getPackageName = (filePath) =>
+      filePath = /(\((.+?):\d+|\((.+)\)|(.+))/.exec(filePath)[1]
+
+      # Stack traces may be a file URI
+      if /file:\/\/(\w*)\/(.*)/.test(filePath)
+        filePath = /file:\/\/(\w*)\/(.*)/.exec(filePath)[2]
+
       if path.isAbsolute(filePath)
         for packName, packagePath of packagePaths
           continue if filePath is 'node.js'

      @getPackageNameFromFilePath(filePath)

    if options.detail?
      file = /(\((.+?):\d+|\((.+)\)|(.+))/.exec(options.detail)[1]

      # Stack traces may be a file URI
      if /file:\/\/(\w*)\/(.*)/.test(file)
        file = /file:\/\/(\w*)\/(.*)/.exec(file)[2]

      packageName = getPackageName(file)
      return packageName if packageName?

    if options.stack?


        # Empty when it was run from the dev console
        return unless file
        packageName = getPackageName(file)
        return packageName if packageName?

