flyntwp / flynt

Component based WordPress starter theme, powered by ACF Pro and Timber, optimized for a11y and fast page load results.
https://flyntwp.com
MIT License
722 stars 82 forks source link

composer install not working twig/cache-extension is abandoned #461

Closed shamimsdp closed 1 year ago

shamimsdp commented 2 years ago

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 commented 2 years ago

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

timohubois commented 2 years ago

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

shamimsdp commented 2 years ago

@timohubois Yes build fails every time.

timohubois commented 2 years ago

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

shamimsdp commented 2 years ago

Here is the script

> flynt@1.4.1 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! flynt@1.4.1 build: `run-s --silent checkVersion clean lint build:production build:rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flynt@1.4.1 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 commented 2 years ago

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

philipphaunstetter commented 2 years ago

Hey 👋

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

shamimsdp commented 2 years ago
> flynt@1.4.1 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! flynt@1.4.1 build: `run-s --silent checkVersion clean lint build:production build:rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flynt@1.4.1 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 commented 2 years ago

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

philipphaunstetter commented 2 years ago

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

shamimsdp commented 2 years ago
> flynt@1.4.1 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! flynt@1.4.1 build: `run-s --silent checkVersion clean lint build:production build:rev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the flynt@1.4.1 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

philipphaunstetter commented 2 years ago

@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

aaronmeder commented 2 years ago

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

timohubois commented 2 years ago

@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 commented 1 year ago

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