A magnitude-6 earthquake hit Taiwan on Tuesday, causing buildings in the capital Taipei to shake. No major damage was caused.