«file_get_contents(<...>/composer.json): failed to open stream: No such file or directory» on «bin/magento sampledata:remove»

When trying to uninstall the sample data in v2.1.0 using the following command:

php bin/magento sampledata:remove

I got the following error:

[Exception]
Warning: file_get_contents(vendor/mage2pro/core/Framework/composer.json): failed to
open stream: No such file or directory in vendor/magento/module-sample-data/Model/
Dependency.php on line 109

I am unable to reproduce it.
Give me SSH access, and I will check it on your server.

It is a Magento 2 core bug.
I have fixed it for my extensions in the 1.7.33 release of the mage2pro/core package.
Though, you will still have this issue for other third-party extensions.

Hello,
I’m having the same problem. I uninstalled the module but when executing the following command:
php bin / magento sampledata: reset

the following error occurs:
[Exception]
Warning: file_get_contents(/home/plataformasescol/public_html/demo/vendor/m
age2pro/core/Core/composer.json): failed to open stream: No such file or di
rectory in /home/plataformasescol/public_html/demo/vendor/magento/module-sa
mple-data/Model/Dependency.php on line 109