Can a spell deal non-lethal damage? [duplicate]

So the rules, to my knowledge, say that a melee attack can be non-lethal. Does this mean that a spell like Inflict Wounds or Primal Savagery can be non-lethal? As for ranged spells, I imagine a volatile spell like Fireball or Lightning Bolt that can hit multiple enemies couldn't be restrained to non-lethal, but what about a single target spell like Chromatic Orb or Eldritch Blast?

marked as duplicate by SevenSidedDie♦ dnd-5e StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 4 at 17:17

• Despite my opening of this question as a duplicate, I feel the answers in the other question are incomplete (compared to Rubiksmoose's answer here) – L0neGamer Jan 4 at 17:22
• @L0neGamer I agree, but the correct solution in the SE system to insufficient answers is to improve or add to the answers using a variety of systems we have in place. (I didn't realize it was a duplicate when I answered). As such I have put an answer on the original question as well. If it is determined to be better or more correct than the current ones, voting will eventually sort it out. – Rubiksmoose Jan 4 at 17:32

Only spells that include a melee attack

First, a note: there is no such thing as "non-lethal damage" in 5e. Instead there is a rule called "knocking a creature out" which is the only way to do damage without killing a creature that the rules provide.

Sometimes an attacker wants to incapacitate a foe, rather than deal a killing blow. When an attacker reduces a creature to 0 hit points with a melee attack, the attacker can knock a creature out. The attacker can make this choice the instant that damage is dealt. The creature falls unconscious and is stable.

Melee attack is a general category including melee weapon attacks as well as melee spell attacks. If a spell includes a melee spell attack, you can choose to apply this rule.

For example, the spell steel wind strike says:

Make a melee spell attack against each target.

Thus, you could apply the rule for knocking a creature out to those attacks. Also worth noting that this spell affects multiple targets. That doesn't matter; as long as it does melee attacks you can choose to knock them out.