drupal-console
drupal-console copied to clipboard
syntax error near unexpected token `<'
syntax error near unexpected token `<'
The issue title should comply with the following structure:
[ ISSUE-GROUP ] console
Problem/Motivation
Followed installation as listed in guide as follows:
$ composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader $ curl https://drupalconsole.com/installer -L -o drupal.phar $ mv drupal.phar /usr/local/bin/drupal $ chmod +x /usr/local/bin/drupal
$ drupal self-update
/usr/local/bin/drupal: line 2: syntax error near unexpected token <' /usr/local/bin/drupal: line 2:
Details to include:
- Why are we doing this? Above all, a summary should explain why a change is needed, in a few short sentences.
How to reproduce
Include steps related how to reproduce.
Details to include:
Drupal version : 9.1.0-dev
drupal/console 1.9.5 The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
drupal/console-core 1.9.6 Drupal Console Core
drupal/console-en 1.9.5 Drupal Console English Language
drupal/console-extend-plugin 0.9.4 Drupal Console Extend Plugin
Using DrupalVM
curl https://drupalconsole.com/installer -L -o drupal.phar
The server is down. Hmm, so it seems the launcher install can't be installed for 3 days already due to server error: ...
500 Server Error
Any updates on this? Server is still down. Any mirrors for the installer?
This seems to be an issue with drupalconsole.com specifically, affecting only the "Global Executable" instructions. Composer installs seem okay to me while https://drupalconsole.com/installer shows an error 500 for me right now.
@senorbond your description seems to use both a composer local install and a global install - you might find that you have a working drupal console in ./vendor/bin
/ ./vendor/drupal/console
already; I've installed D9 projects during the last month and had Drupal console (v1.9.5) install fine via the composer method ... but the alternate approach does seem broken right now :grimacing:
In Slack it looks like this issue has been raised repeatedly since August :disappointed:
I too receive this error. Composer installed it just fine but any drupal command results in this same error, any resolution to this? Running a MAC with the latest OS X.
$ drupal
/usr/local/bin/drupal: line 2: syntax error near unexpected token <' /usr/local/bin/drupal: line 2:
Here's the process to install Drupal Console via Composer, which worked for me last time I tried it.
https://drupalconsole.com/docs/en/getting/composer
If you want a global install, you could composer global require drupal/console
... that approach is apparently discouraged by the authors of Drupal Console BUT at least it might work :wink:
I receive the same error. Running a mac with latest OSX using Composer to install Drupal Console.
/usr/local/bin/drupal: line 2: syntax error near unexpected token <' /usr/local/bin/drupal: line 2:
Same here, the problem is the server, the downloaded file have inside this:
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
That was a real battle, pretty ridiculous. I ended up getting around the error by installing using composer composer global require drupal/console:@stable which composer version 2 installed it to ~/.config/composer/vendor/drupal/console/bin I then copied it from that directory to a directory that was in my path with sudo cp drupal /usr/local/bin/drupal
You might also have to chmod +x /usr/local/bin/drupal
I see the documentation saying not to install it globally, only on a per project basis, but most of the developers on my team do not want drupal console and I don't want to force it on them by requiring it as part of a project. Globally seems like a better solution in my case.
Edit: nope still not working, I can execute Drupal console from the ~/.config/composer/vendor/drupal/console/bin folder but not anywhere else. I guess Drupal console is in practically an abandoned project, at least if installing it per project is a no go.
@plato1123 comment above has a global install method for you, https://github.com/hechoendrupal/drupal-console/issues/4263#issuecomment-713981342
@hechoendrupal is there any way the community should support you in maintaining this project? Is it still active / alive?
Issue is reported in these other locations:
- hechoendrupal/drupalconsole.com#132
- https://www.drupal.org/project/console/issues/3166345
- #4275
While the installer instructions are broken because the installer URL is inaccessible, there are some workarounds in the comments above - folks, please read those to save yourself repeating others posts.
SEE https://github.com/hechoendrupal/drupal-console/issues/4263#issuecomment-713981342
You can find the releases here. https://github.com/hechoendrupal/drupal-console-launcher/releases