Powering a STM32 Nucleo board using batteries/power bank
The NUCLEO board needs enumeration from USB host if it is powered from USB connector.

USB power banks nor wall adapters can't provide USB enumeration, they are not intelligent.

To power the board without USB enumeration, you need to make a special cable, and connect 5V to E5V pins on JP5 (see Table 8), and the other (GND) to ground pin of the NUCLEO.

Also keep in mind that if your NUCLEO would occasionally go to sleep state and the consumption drops below 50 - 70 mA, many powerbanks would drop the supply (to save their internal power), so your system will shut down catastrophically. To see your options, search for "powerbank" in SE, like this one.