Error CS0246 in Editor Scripts

I have been working on a project for a while without problems and all of a sudden I keep getting hit with a CS0246 missing type or namespace error in one of the Unity Editor’s own scripts:

Library\PackageCache\com.unity.visualscripting@1.7.8\Editor\VisualScripting.Core\Analysis\AnalyserProvider.cs(5,87): error CS0246: The type or namespace name ‘AnalyserAttribute’ could not be found (are you missing a using directive or an assembly reference?)

I was previously using Unity 2021.2.9f1 but then remade my project in Unity 2021.3.8f1 after encountering the error initially which has appeared again.

I have not touched any script within the Unity Editor so this is increadibly frustrating especially when I have uninstalled and reinstalled all Unity programs in order to get rid of the issue causing this. If there is anyway to get around or to fix this I would greatly appreciate the assistance.

Do you need this package? If so you will need to find and satisfy its dependencies.

Otherwise, remove it.

Extra unwanted packages in new projects (collab, testing, rider and other junk):

About the fastest way I have found to make a project and avoid all this noise is to create the project, then as soon as you see the files appear, FORCE-STOP (hard-kill) Unity (with the Activity Manager or Task Manager), then go hand-edit the Packages/manifest.json file as outlined in the above post, then reopen Unity.

Sometimes the package system gets borked from all this unnecessary churn and requires the package cache to be cleared: