-
Notifications
You must be signed in to change notification settings - Fork 936
Composer cannot find the drupal-scaffold command in post-install.sh #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, your problem is not specifically
Do you have |
Side note: it should no longer be necessary to adjust the version/branch of drupal-scaffold in your composer.json file. Run It will still be necessary to have |
I don't think this is related to having composer in my $PATH. I'm using Git Bash to run ./scripts/composer/post-install.sh. If I run the command manually, it does the same thing with the "composer: command not found" error. If I run "composer" manually, it works fine. I'm not sure what else is going on here. composer drupal-scaffold just doesn't work on Windows... if I run manually:
PS I've updated back to ~1 for drupal-scaffold and it's getting 1.1.1 with robo 0.7.0. |
I think that if we used the PHP curl API to download files instead of Guzzle, then we could call Robo directly rather than exec'ing it. This would probably be the best way to solve this problem. I am curious, though: if you manually run |
In Git Bash, this works (using forward slash path separators. In MS-DOS this does not work. It says "is not recognised as an internal or external command". Ideally it would work either way, but I think it's that Windows doesn't understand "executable" files because it's Windows, so another method might be required. |
Please try with drupal-composer/drupal-scaffold#26 and see if that clears up your problems on Windows. |
Sorry. I don't know what you mean by that. What do I need to change to use that branch or whatever it is? |
In the Then, run |
Okay, looks like that worked. It didn't fix it completely, but here's my latest output:
|
Another thing to test would be to use the zip archive of Drupal rather than the tar.gz. Add this to your composer.json:
You'll need to merge this with any existing That might work. UPDATE: Corrected URL above. |
|
BTW PEAR is installed via Acquia Dev Desktop on this machine. I'm not sure but it's something to do with the fact that Windows is terrible and on every other OS there's a standard way of putting PEAR on your system, but you have to be really fiddly to even get it running on Windows. |
Instructions on installing PEAR: https://pear.php.net/manual/en/installation.getting.php Ideally, it should not be necessary to install additional software to use drupal-composer/drupal-project, but you might wish to try this as an interim measure. |
Relying on PEAR sounds like a recipe for pain, maybe we can find an Archive package on Packagist and use that instead? |
Previously we were using zippy; this uses executables, wheras the archive package we are using now is based entirely on php code. Maybe we need both. I do not think there is an archive package available that does not rely on any external component. |
Actually, the problem is not that PEAR is missing; it is available via Composer. The problem we have is that PEAR uses I'm not sure why this isn't an issue on other platforms; I will investigate further. |
Okay, I found a solution, but it will require a change in Archive_Tar. The problem is that Archive_Tar does a I did a test on my system that involved renaming PEAR to PEAR2, to simulate a system that did not have PEAR installed, and it seems like my solution should work fine. It would be helpful if someone with a Windows system (maybe @chriscohen?) could also run a test for me, to confirm whether this does in fact work in their environment.
If this works, then I will submit a PR with explanation to the Archive_Tar project. It would also be very helpful if someone could test to see if zip files work better, per the instructions above. If this works, then I can simply change the default URL in drupal-scaffold to point at the zip file, which would serve as a reasonable workaround until such a time as the Archive_Tar fix was merged in to the upstream. |
That does work fine for the extraction process! Thanks for that suggestion. The next problem is that Windows does not have rsync available (derp).
|
@chriscohen: Great, thanks; I'll put in a PR with the Archive_Tar project. Could you also test .zip files (without the Archive_Tar modification) and let me know if that works as well?
|
My PR in Archive_Tar has already been merged, and a new version was tagged, so now we are just down to needing a replacement for rsync. |
I am getting a similar error but from a ^M character (windows line ending char) in the post-install.sh script. I am installing on an ubuntu server |
@Lowell20: The problem you are having is similar but unrelated to the problem being tracked in this issue. Could you please open a new report, and include more information on the errors you are seeing? |
@Lowell20 |
lol, hey thanks! that's exactly what I figured out :-) |
@chriscohen Is it still an issue on Windows? Or do you have any workarounds? |
I believe that everything is working on Windows if rsync is installed; however, many Windows users do not have rsync, so it would be good to use a native PHP equivalent here instead. |
#128 should resolve the original bug report |
I have tweaked the DOCUMENTROOT variable in post-install.sh to be something else because "web" won't work for us as a directory name.
I have also tweaked the "drupal-composer/drupal-scaffold" to use "dev-use-better-apis" because of the apparent bug preventing the main branch from working at the moment.
Everything seems to download fine in composer, but then the post-install.sh script has issues straight away.
The vendor dir definitely contains the class in question, but I don't know enough about this side of composer to know why it apparently cannot find the drupal-scaffold command as defined.
The text was updated successfully, but these errors were encountered: