Optimization of power management of nanogrid based on short-term prediction of PV power production and consequent EV charging/discharging is proposed. Goal of power management is to reduce time-based electricity cost and total delay. To achieve the goal, efficiency in the combined use of PV power and EV charging/discharging power is important. Unlike the PV power used ahead of costly grid power and entirely dependent on weather condition, timing of EV charging/discharging depends on power management scheme. In order to find out the timing for EV charging/discharging, short-term prediction of PV power production is considered as a key contributor. When PV power production is predicted to decrease in short-term, e.g., 10minutes, discharging power of EVs can compensate the loss and, when predicted to increase in short-term, EVs are charged to capitalize on the gain. Short-term prediction of PV power production is performed by long short-term memory (LSTM) network trained and validated by dataset of PV power production over 1 year. In addition, variation of outdoor temperature in relation to indoor temperature is factored in to determine the timing for EV charging/discharging. Our work is comprehensive in that various electric appliances as well as PV source and EVs are taken into account for power management of nanogrid. Simulation results show the cost benefit obtained from the short-term prediction of PV power production and consequent EV charging/discharging while managing peak demand below maximum allowed level.