composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

1.6.7 Install error: src/Patches.php - no such file or directory

Open keithstewart23 opened this issue 6 years ago • 15 comments
trafficstars

Hi

I get a very odd error when running 'composer require cwaegans/composer-patches' on my Drupal VM website directory:

_- Installing cweagans/composer-patches (1.6.7): Loading from cache Plugin installation failed, rolling back

  • Removing cweagans/composer-patches (1.6.7)

Installation failed, reverting ./composer.json to its original content.

[ErrorException]
include(/var/www/drupalvm/reading-challenge/vendor/cweagans/composer-patches/src/Patches.php): failed to open stream: No such file or directory_

I can see from the code that the file exists in src/Plugins/Patches.php, not src/Patches.php.

Suprised nobody else has had this problem? Makes me think there is something specific about my environment that is messing it up. Same thing happens for any version that I attempt to install.

Any thoughts?

keithstewart23 avatar Oct 04 '19 11:10 keithstewart23

Same problem here.

mgathu1 avatar Oct 05 '19 03:10 mgathu1

One more, same problem.

aaronvaca avatar Oct 22 '19 16:10 aaronvaca

Similair problem here.

  • Installing cweagans/composer-patches (1.6.7): Loading from cache", "Plugin installation failed, rolling back", " - Removing cweagans/composer-patches (1.6.7)", "", "Installation failed, reverting ./composer.json to its original content.", "", " ", " [UnexpectedValueException] ", " Plugin cweagans/composer-patches could not be initialized, class not found: cweagans\Composer\Patches "

csmith31247 avatar Oct 22 '19 20:10 csmith31247

Same here, vagrant on macOS, install in shared dir.

Amstutz avatar Jan 30 '20 11:01 Amstutz

Same here, vagrant 2.2.7 on Win10

tomo-dev-2018 avatar Feb 05 '20 13:02 tomo-dev-2018

I also have this problem, does anyone know a solution?

sbrow avatar Feb 18 '20 16:02 sbrow

Sounds like a lot of these are vagrant. To start narrowing down what might be happening, can you please provide some details about how the files are mounted/copied into the VM? NFS? rsync? Something else?

cweagans avatar Feb 20 '20 23:02 cweagans

I encountered this error using vagrant with a kubuntu linux guest on a windows host. I solved it by deleting my vendor directory and composer.json, and re-running composer install.

sbrow avatar Feb 23 '20 05:02 sbrow

I am experiencing this issue with drupalvm (running vagrant/virtualbox) with the default share type, if I change it to NFS a composer install seems to work fine.

Unfortunately, NFS shares break with a certain Mac update our development team as a workaround is using the default share type.

mdance avatar Jun 04 '20 23:06 mdance

Has anybody been able to resolve this? I am getting this issue when I'm trying to create drupal project using composer on vagrant shared folder inside VM on Windows.

amandeep-singh9 avatar Jun 24 '20 12:06 amandeep-singh9

try running with the --no-plugins flag

danlobo02 avatar Jun 29 '20 14:06 danlobo02

--prefer-source flag worked for me

rfmarcelino avatar Sep 30 '20 14:09 rfmarcelino

This breaks any production build having a composer-lock. Any resolution?

pokono avatar Oct 22 '20 04:10 pokono

Having this same issue. Mac, Vagrant, breaking on composer install...

jeffreysmattson avatar Apr 26 '21 15:04 jeffreysmattson

I really can't help without details here and nobody has provided anything concrete. The most expedient thing would be a simple Vagrantfile that reproduces the problem, but literally any detail would help here. Details about macOS version, Vagrant version, etc would help here.

try running with the --no-plugins flag

Note that this will cause patches to not be applied, as it disables composer-patches (and any other composer plugin you have installed).

cweagans avatar Apr 26 '21 15:04 cweagans