Flights were cancelled and evacuation warnings were issued for thousands of people as a powerful typhoon approached Japan's northeast.