pug-php / pug

Pug template engine for PHP
https://www.phug-lang.com
MIT License
387 stars 42 forks source link

Recent problems installing using Composer - Installation failed after 3 tries. #191

Closed MikeDombo closed 6 years ago

MikeDombo commented 6 years ago

Hello, I'm working on a CI script that used to work using the Docker php images, specifically php:5.6 or php:7.0. These used to work, but now I'm getting the error:

Package added to be installed/updated with npm: jstransformer@"^1.0.0"
Package added to be installed/updated with npm: pug-cli@"^1.0.0-alpha6"
Installation failed after 3 tries.

I have installed nodejs and npm from apt, but I'm still getting this error.

kylekatarnls commented 6 years ago

Hi, could you paste the complete log and log npm -v in this run. I have an app with last pug-php version running unit tests and deploy via Docker. So it must be possible. Is the composer install with the --no-interactions option (-n)?

MikeDombo commented 6 years ago

NPM version

$ npm -v
1.4.21

Composer version

$ php ../composer.phar
Do not run Composer as root/super user! See https://getcomposer.org/root for details
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.6.3 2018-01-31 16:28:17

Composer Install

$ php ../composer.phar require --no-update phpunit/phpunit:^5.7
Do not run Composer as root/super user! See https://getcomposer.org/root for details
./composer.json has been updated
$ php ../composer.phar install --no-dev --ignore-platform-reqs
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Package operations: 21 installs, 0 updates, 0 removals
  - Installing nodejs-php-fallback/nodejs-php-fallback (1.3.1): Downloading (connecting...)Downloading (100%)         
  - Installing js-phpize/js-phpize (1.12.0): Downloading (connecting...)Downloading (100%)         
  - Installing js-transformer/js-transformer (1.0.0): Downloading (connecting...)Downloading (100%)         
  - Installing phug/event (0.1.0): Downloading (connecting...)Downloading (100%)         
  - Installing phug/util (0.4.12): Downloading (connecting...)Downloading (100%)         
  - Installing symfony/polyfill-mbstring (v1.6.0): Downloading (connecting...)Downloading (0%)           Downloading (35%)Downloading (90%)Downloading (100%)
  - Installing psr/http-message (1.0.1): Downloading (connecting...)Downloading (0%)           Downloading (100%)
  - Installing phug/reader (0.2.1): Downloading (connecting...)Downloading (100%)         
  - Installing phug/lexer (0.5.17): Downloading (connecting...)Downloading (100%)         
  - Installing phug/ast (0.1.0): Downloading (connecting...)Downloading (100%)         
  - Installing phug/parser (0.5.8): Downloading (connecting...)Downloading (100%)         
  - Installing phug/dependency-injection (1.3.2): Downloading (connecting...)Downloading (100%)         
  - Installing phug/formatter (0.5.36): Downloading (connecting...)Downloading (100%)         
  - Installing symfony/var-dumper (v3.4.2): Downloading (connecting...)Downloading (0%)           Downloading (10%)Downloading (20%)Downloading (25%)Downloading (30%)Downloading (35%)Downloading (45%)Downloading (55%)Downloading (65%)Downloading (75%)Downloading (85%)Downloading (95%)Downloading (100%)
  - Installing phug/compiler (0.5.16): Downloading (connecting...)Downloading (100%)         
  - Installing phug/renderer (0.3.5): Downloading (connecting...)Downloading (100%)         
  - Installing phug/phug (0.2.1): Downloading (connecting...)Downloading (100%)         
  - Installing phug/js-transformer-filter (1.0.1): Downloading (connecting...)Downloading (100%)         
  - Installing js-phpize/js-phpize-phug (1.1.7): Downloading (connecting...)Downloading (100%)         
  - Installing pug-php/pug (3.1.4): Downloading (connecting...)Downloading (100%)         
  - Installing symfony/yaml (v4.0.4): Downloading (connecting...)Downloading (0%)           Downloading (5%)Downloading (10%)Downloading (25%)Downloading (30%)Downloading (35%)Downloading (60%)Downloading (65%)Downloading (70%)Downloading (75%)Downloading (80%)Downloading (100%)
Generating autoload files
Package added to be installed/updated with npm: jstransformer@"^1.0.0"
Package added to be installed/updated with npm: pug-cli@"^1.0.0-alpha6"
Installation failed after 3 tries.
kylekatarnls commented 6 years ago

OK, you should add the --no-interaction. A composer command ran automatically should always use this option:

php ../composer.phar install --no-interaction --no-dev --ignore-platform-reqs

It should pass with it.

To explain: without this option, our install ask to the user if he want to install the optional nodejs packages and wait for Y or N. As nothing is entered, the process timeout.

With the option, all questions (can be scripts for any of your dependencies, frameworks use it a lot to ask settings) will be answered with the default value.

MikeDombo commented 6 years ago

That is interesting to note. I actually did get it to work by installing node from the node people instead of the builtin apt repository.

Everything seem ok now, thanks!