The man was waving the 20-inch machete at people in the parking lot of a Lake Grove Costco, Newsday reports.
Police found the man barricaded inside the cab of a tractor-trailer he operated for a New Jersey company, according to Newsday. He initially refused to get out of the truck, which contained clothes and a microwave, but later tried to get out with the machete as officers tried to contain him, the report said.
He eventually tried to get out through a small truck window, and police subdued him. Officers allegedly found cocaine in the cab, according to Newsday.
The man was charged with menacing a police officer, criminal possession of a controlled substance and criminal possession of a weapon, the report said. He was taken to a nearby hospital for evaluation and was expected to be arraigned Tuesday.