Because VSCode and npm are popular.
It’s not like Ruby gems are immune to this. They just aren’t as popular.