How can I disable a troublesome module? I've been playing around with D8 and have managed to break a few things I can't figure out how to fix. Most recently, after installing (via manually adding the module code to the modules folder) the Name Field module and subsequently enabling it in the Admin panel, my Drupal 8 instance started throwing fatal PHP errors. No problem, I thought, apparently the module has a bug and I'll just remove it for now. Not so easy. I removed the module folder from my instance, but the errors are persisting.

Not that the specific error matters as this question is not about troubleshooting the module, but here's an example of something I get after removing the module code:


  Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginException: "Plugin (name) instance class "Drupal\name\Element\Name" does not exist." at /srv/http/drupal.protestan.org/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php line 87


Is there a way to disable a malfunctioning module without being able to load the control panel? I've looked around but all the hacks for D6/D7 including tweaking the database manually don't seem to apply any more. At the very least the layout has changed and I was unable to find the corresponding bit to toggle. Likewise  the current version of drush does not seem to be able to cope with D8 yet.

Is my whole database borked? Is there a secret URL or other way to load the Admin panel with no modules enabled (i.e. some sort of safe mode)?
You seem to be having two issues: this module (i.e. PHP Fatal Errors resulting from something that's broken in the module) and Drush.

Let's start by the easiest fix, Drush.

Make sure you have Drush 8 (or 9-dev), which is the only version compatible with Drupal 8. Run $ drush --version to know for sure. If you're not running Drush 8, then, read the documentation and install it via Composer.

As to your module issue, my best bet at this point would be to put the module back in place where it was so that Drupal can see it, else, it'll never be in a position to trigger the uninstall process if the module isn't there. Once it's back (under the /modules directory at the root of your Drupal install), run the $ drush pm-uninstall -y command which will not disable the module (this has been removed completely from D8) but uninstall it completely. If it doesn't fail during the process, then, chances are that everything will be fine. If you do have issues during the uninstall phase, try to visit the /admin/modules/uninstall page to uninstall the module from the UI (assuming something didn't work well with Drush).

If nothing works, try to rebuild the cache (/admin/config/development/performance or $ drush cr) and repeat the above operation. Finally, if you're still stuck, I'd advise you report your bug (at the very least the PHP error message) in the module's issue queue. Note that it should not be the error you mentioned earlier since you got it after you removed the module from its original location.