I see this dialog when trying to run my VS Code extension:

However there were actually no errors generated during the running of npm. If I click Show Problems, I see this:

These errors are all Dart errors. They all existed before (and are unrelated to) npm: watch.
It would be great if it only looked at the npm errors, though if that's not possible, I think the dialog should be reworded to just say there are build errors to avoid suggesting that there are npm errors (slightly related is #51341, which was a request to make handling of this more general for other extensions).