Skip to content
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

syntax error near unexpected token `<' #4263

Open
senorbond opened this issue Aug 23, 2020 · 10 comments
Open

syntax error near unexpected token `<' #4263

senorbond opened this issue Aug 23, 2020 · 10 comments

Comments

@senorbond
Copy link

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

@DavisAre
Copy link

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

<title>500 Server Error</title>

@philmorley
Copy link

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

@xurizaemon
Copy link

xurizaemon commented Oct 10, 2020

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 😬

In Slack it looks like this issue has been raised repeatedly since August 😞

@itfm
Copy link

itfm commented Oct 21, 2020

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

@xurizaemon
Copy link

xurizaemon commented Oct 21, 2020

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 😉

@hartly97
Copy link

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

@RAFA3L
Copy link

RAFA3L commented Oct 24, 2020

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

<title>500 Server Error</title>

Error: Server Error

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

Please try again in 30 seconds.

@plato1123
Copy link

plato1123 commented Nov 2, 2020

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.

@xurizaemon
Copy link

xurizaemon commented Nov 2, 2020

@plato1123 comment above has a global install method for you, #4263 (comment)

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

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 #4263 (comment)

@boganegru
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants