drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

syntax error near unexpected token `<'

Open senorbond opened this issue 3 years ago • 10 comments

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

senorbond avatar Aug 23 '20 00:08 senorbond

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

DavisAre avatar Aug 25 '20 19:08 DavisAre

Any updates on this? Server is still down. Any mirrors for the installer?

philmorley avatar Sep 24 '20 16:09 philmorley

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.

image

@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:

xurizaemon avatar Oct 10 '20 18:10 xurizaemon

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:

'

itfm avatar Oct 21 '20 22:10 itfm

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:

xurizaemon avatar Oct 21 '20 23:10 xurizaemon

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:

'

hartly97 avatar Oct 24 '20 03:10 hartly97

Same here, the problem is the server, the downloaded file have inside this:

500 Server Error

Error: Server Error

The server encountered an error and could not complete your request.

Please try again in 30 seconds.

RAFA3L avatar Oct 24 '20 21:10 RAFA3L

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 avatar Nov 02 '20 02:11 plato1123

@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

xurizaemon avatar Nov 02 '20 03:11 xurizaemon

You can find the releases here. https://github.com/hechoendrupal/drupal-console-launcher/releases

boganegru avatar Mar 07 '22 14:03 boganegru