silverstripe / vendor-plugin

Allows Silverstripe vendor modules to expose directories to the webroot
BSD 3-Clause "New" or "Revised" License
5 stars 15 forks source link

"composer require silverstripe/userforms" - cannot install on windows 10 #24

Open DmitryKuh opened 6 years ago

DmitryKuh commented 6 years ago

I'm trying to add the user forms (composer require silverstripe/userforms) on Windows 10 and got the following error:

Using version ^5.2 for silverstripe/userforms ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 3 installs, 0 updates, 0 removals

Installing silverstripe/segment-field (2.2.1): Loading from cache Exposing web directories for silverstripe-vendormodule silverstripe/segment-field with method auto: client/dist [Symfony\Component\Filesystem\Exception\IOException] C:\ss\public\resources\vendor\silverstripe\segment-field\client\dist is not a junction and thus cannot be removed as one

It is sound like somewhere trying to delete a symbolic link to a directory using rmdir command.

Is there any solutions/fixes to avoid this issue?

Tried to use "composer vendor-expose copy"... No luck: [ErrorException] copy(C:\ss\vendor\silverstripe\segment-field\client\dist): failed to open stream: No such file or directory

AljosaB commented 5 years ago

I have bumped into this kind of problem yesterday and I took the whole day to find a solution that worked for me. While composer worked for months I don't really know what I did but it stopped working yesterday. And it stopped working on all of my projects, specifically when "exposing directories". After some research I found these (without a single solution):

https://github.com/silverstripe/vendor-plugin/issues/15 https://github.com/silverstripe/silverstripe-userforms/issues/803 https://github.com/silverstripe/vendor-plugin/issues/24 https://forum.silverstripe.org/t/composer-create-project-install-fails-on-win10-php7/963 https://slackarchive.silverstripe.org/slack-archive/channel/ss4/?message=151661&start=35340#msg_151661

Everything started working again when I changed the PHP version that composer is using from 7.2 -> 7.1. And btw, composer simply uses the PHP version that is set in environment path (it doesn't have a separate setting).

maxime-rainville commented 5 years ago

Have you tried manually removing your resources folder and explicitly calling composer vendor-expose?

Is switching between PHP 7.1 and 7.2 systematically causing a failure?