The merge of #3470 moved the Flutter check in scripts/lib/project-detect.js
onto js-yaml with a top-level require. session-start.js loads that module
on every SessionStart, and plugin installs have no node_modules (#2822),
so the hook now exits 1 with "Cannot find module 'js-yaml'" in every
project, not only Dart ones.
Require js-yaml inside hasFlutterSdkDependency instead. When it is
missing, the existing catch returns false: Dart is still detected from
pubspec.yaml and only the Flutter refinement is skipped. Installs that
have their dependencies behave as before.
Add a case to the no-node_modules plugin install test that runs
session-start.js against a pubspec.yaml project. It fails on main.