flynt icon indicating copy to clipboard operation
flynt copied to clipboard

composer install not working twig/cache-extension is abandoned

Open shamimsdp opened this issue 2 years ago • 14 comments

I've tried with composer latest version then found this issue. Later i tried with composer 1.9.0 and 1.8.0 still same. Package twig/cache-extension is abandoned, you should avoid using it. Use twig/cache-extra instead.

Can anyone help me to run composer install command.

shamimsdp avatar Sep 14 '22 20:09 shamimsdp

Here is some more from console composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Package twig/cache-extension is abandoned, you should avoid using it. Use twig/cache-extra instead. Package twig/extensions is abandoned, you should avoid using it. No replacement was suggested. Generating autoload files

shamimsdp avatar Sep 14 '22 20:09 shamimsdp

@shamimsdp regarding to the provided console output it looks that the composer has done his job as he should. What exactly does not work?

And did get you also errors when you execute npm i && npm run build inside the theme folder?

timohubois avatar Sep 14 '22 21:09 timohubois

@timohubois Yes build fails every time.

shamimsdp avatar Sep 15 '22 03:09 shamimsdp

@shamimsdp can you provide the log of the build script here?

timohubois avatar Sep 15 '22 10:09 timohubois

Here is the script

> [email protected] build C:\Users\shami\DevKinsta\public\imagery\wp-content\themes\flynt-1.4.1
> run-s --silent checkVersion clean lint build:production build:rev

node: 14.15.0

FILE: ...y\wp-content\themes\flynt-1.4.1\lib\Utils\TwigExtensionFlynt.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 11 | ERROR | [x] Opening brace must not be followed by a blank
    |       |     line (PSR12.Classes.OpeningBraceSpace.Found)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 1.93 secs; Memory: 10MB

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `run-s --silent checkVersion clean lint build:production build:rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shami\AppData\Roaming\npm-cache\_logs\2022-09-15T16_35_28_934Z-debug.log

shamimsdp avatar Sep 15 '22 16:09 shamimsdp

Here is the debug log file 2022-09-15T16_35_28_934Z-debug.log

shamimsdp avatar Sep 15 '22 16:09 shamimsdp

Hey 👋

Did you try using node 12 instead of node 14 as 12 is the correct version to be used for flynt ?

philipphaunstetter avatar Sep 15 '22 16:09 philipphaunstetter

> [email protected] build C:\Users\shami\DevKinsta\public\imagery\wp-content\themes\flynt-1.4.1
> run-s --silent checkVersion clean lint build:production build:rev

node: 12.22.12

FILE: ...y\wp-content\themes\flynt-1.4.1\lib\Utils\TwigExtensionFlynt.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 11 | ERROR | [x] Opening brace must not be followed by a blank
    |       |     line (PSR12.Classes.OpeningBraceSpace.Found)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 725ms; Memory: 10MB

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `run-s --silent checkVersion clean lint build:production build:rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shami\AppData\Roaming\npm-cache\_logs\2022-09-15T17_06_42_382Z-debug.log

still same issue @philipphaunstetter

shamimsdp avatar Sep 15 '22 17:09 shamimsdp

@philipphaunstetter is there any specific version required? Can you give me that node 12 version?

shamimsdp avatar Sep 15 '22 17:09 shamimsdp

@philipphaunstetter is there any specific version required? Can you give me that node 12 version?

You can find all dependencies here.

I just cloned a project again and everything works really fine for me.

@timohubois are there more things going on with windows? I am not familiar with windows :)

@shamimsdp node: 14.20.0 works fine for me ...

philipphaunstetter avatar Sep 15 '22 17:09 philipphaunstetter

> [email protected] build C:\Users\shami\DevKinsta\public\imagery\wp-content\themes\flynt-1.4.1
> run-s --silent checkVersion clean lint build:production build:rev

node: 14.20.0

FILE: ...y\wp-content\themes\flynt-1.4.1\lib\Utils\TwigExtensionFlynt.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 11 | ERROR | [x] Opening brace must not be followed by a blank
    |       |     line (PSR12.Classes.OpeningBraceSpace.Found)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 2.72 secs; Memory: 10MB

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `run-s --silent checkVersion clean lint build:production build:rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\shami\AppData\Roaming\npm-cache\_logs\2022-09-15T17_32_27_155Z-debug.log

My dependencies: PHP 7.4.1 node v14.20.0 Composer 1.8.0

shamimsdp avatar Sep 15 '22 17:09 shamimsdp

@shamimsdp can you try to fix the error mentioned in the build process? Remove the blank line (line 12?!) in the file TwigExtensionFlynt.php and rerun the build

philipphaunstetter avatar Sep 15 '22 17:09 philipphaunstetter

@shamimsdp The problem you seem to have during the build is a "linting" problem. During the build it is checked that the code follows certain rules. It's usually about "styling" of the code (as in your case not having unnecessary blank lines) and probably doesn't mean there is a functional problem in your code or that it's broken.

What you can do is either follow the rules and in this case fix the "Opening brace must not be followed by a blank | | line (PSR12.Classes.OpeningBraceSpace.Found)" error or just use npm run build:production to build without checking the linting rules.

If you want to use linting, which is generally a good idea in my opinion, the easiest is to enable an autofixer that is run each time you save a file in your editor. I use PHP Sniffer & Beautifier in Visual Studio Code for example.

aaronmeder avatar Sep 16 '22 06:09 aaronmeder

@shamimsdp it seems that there is a linting error at the current release, which was not showing before.

Please navigate to the theme folder an execute this command: npm run lint:php:fix && npm run build

Does this help?

timohubois avatar Sep 16 '22 06:09 timohubois

@shamimsdp the issue should be fixed now, see #464

timohubois avatar Oct 24 '22 10:10 timohubois