Nano 32 with single WS2812 LED not working

I removed the second line, and I found the solution

LED strip libraries not working with Arduino Nano ESP32.

I changed pins 2 to 5 in the sketch while connecting the data pin to D2 on the board.