It was one of up to five devices found in backpack inside a rubbish bin near the station in Elizabeth, according to the city's mayor. No-one was hurt.
"That was not a controlled explosion," said Mayor Christian Bollwage, adding that the blast happened as a robot examining a device cut a wire.
The bag containing a multiple devices was picked out of a bin by two men who thought it could contain something of value.
The discovery came after three attacks at the weekend - bombs in New York and New Jersey, and stabbings in Minnesota.
The explosion in New York's Chelsea area injured 29 people.