State and local officials had plenty of warning that the West Side bike path was vulnerable to a terror attack like the one that left eight people dead on Halloween, sources told The Post Wednesday.

Between January and October 2017 alone, park officers issued 50 tickets — and made one DUI arrest — for people driving on the bike path, according to data provided by NYC Park Advocates and confirmed by the city Parks Department.

Park Enforcement Patrol officers said they provide daily incident data to the Hudson River Park Trust, a joint state-city entity that maintains the bike path.

Still, no action was taken until after the Oct. 31 carnage.

“For years, the Hudson River Park Trust ignored dangerous public safety concerns regarding the bike path, which contributed to the needless deaths and injures of innocent people,” said Geoffrey Croft, who heads NYC Park Advocates.

“The Trust was well aware that vehicles had easy access to the bike path and they did nothing. Their inaction was unconscionable and negligent.”

When confronted with the summons figures, the Trust argued that some citations could have been issued to electric-bike operators or for other infractions, like cars blocking the bike path.

But the data, which was prepared at the request of the Mayor’s office after the terror attack, specifically referred to vehicles driving on the path, city sources said.

It was only after terror suspect Sayfullo Saipov mowed down dozens of people — killing 8 — that barriers were installed at 57 intersections along the West Side path.

City Councilman Ydanis Rodriguez (D-Manhattan) — who has been pushing legislation since June that would require the city to install bollards in front of schools, public plazas and busy corridors — said the bike path should have been made safer years ago.

“That situation at [Hudson River Park] should have been addressed with bollards a long time ago,” he said.

“I hope we can learn from this tragedy and look at other areas of the city that are just as vulnerable.”

Three PEP officers say motorists have been illegally driving down the West Side bike path for years.

“No one should be surprised there was a successful terror attack here, because the Hudson River Park Trust puts a lot more emphasis into fund-raising for the park and replacing stolen flower plants than safety,” said one PEP officer.

The Trust said that while it controls the entire Hudson River Park, the state Department of Transportation owns the bike path.

“Security is one of the Trust’s largest budget items and the park’s safety is our top priority,” said a Trust spokesman.

“While the path is not Trust property, we are working with the state and city to maintain and install additional security and will work with PEP on enforcement measures.”

State DOT spokesman Joseph Morrissey said the bike path’s safety is a “top priority” for his agency and that it has “always worked diligently to assess the effectiveness of existing infrastructure and provide additional security measures as required.”

In 2006, a 22-year-old cyclist, Eric Ng, was killed by a drunk driver on the West Side bike path.

“I wish they did it before because my son would still be alive,” Eric Ng’s father, Tony, told The Post at his East Brunswick, NJ, home.

“All those people would all still be alive today. I thought it was horrible. I wish they’d done something before my son was killed.”

After Ng was killed, the state DOT installed six metal bollards along the path at the Trust’s request — but not at key openings like the one at West Houston Street, where Saipov entered.

Additional reporting by Alex Taylor