Yes, though none of the additional effects happen. You just make the melee attack, which unless the weapon is magical, does not count as magical damage. At higher levels you'll gain fire damage to the melee attack against the initial target, but the weapon damage is the same (magical or non-magical) as the weapon you are using for the spell's material component.
editing for clarification:
As part of the action used to cast this spell, you must make a melee attack with a weapon against one creature within the spell’s range, otherwise the spell fails. On a hit, the target suffers the attack’s normal effects, and green fire leaps from the target to a different creature of your choice that you can see within 5 feet of it. The second creature takes fire damage equal to your spellcasting ability modifier.
This spell’s damage increases when you reach higher levels. At 5th level, the melee attack deals an extra 1d8 fire damage to the target, and the fire damage to the second creature increases to 1d8 + your spellcasting ability modifier. Both damage rolls increase by 1d8 at 11th level and 17th level.
can you still use if there is no one for the flames to leap to ?
Yes, though none of the additional effects happen. You just make the melee attack, which unless the weapon is magical, does not count as magical damage. At higher levels you'll gain fire damage to the melee attack against the initial target, but the weapon damage is the same (magical or non-magical) as the weapon you are using for the spell's material component.
editing for clarification:
cool ty