Put text on an image

Why doesn’t it work below, how do I put text on an image?

let text = svg.append(‘text’)
.attr(‘font-size’, ‘16’)
.attr(‘fill’, ‘black’)
.attr(‘x’, 50)
.attr(‘y’, 50)
.attr(‘width’, 40)
.attr(‘height’, 20);

:smile:
Thanks!