Sure; but npm packages are much more likely to still be around in a few years than some random startup’s web app. Even the original developers can’t take their own code off npm in most cases any more. And if you really needed to replace a package you depend on, most useful packages on npm have a bunch of good-enough alternatives you can switch to with a little bit of effort.