Script cache:clear returned with error code 255
Asked Answered
S

7

14

I installed Symfony 4.2 via composer

composer create-project Symfony/website-skeleton my-project

everything works correctly, then I put the project in gitlab. a friend of mine tried to clone it on its own computer in order to work on the same project, and when he runs composer install

he got an error :

Script cache:clear returned with error code 255

Frankly, I tried everything I can find on the web and Stack Overflow but unfortunately, i didn't succeed.

Thanks in advance for any help

Sabrinasabsay answered 24/2, 2019 at 12:14 Comment(3)
Check this github.com/symfony/flex/issues/329, Maybe you can get some idea here.Incontrollable
As a temporary solution, your friend can run command with --no-scripts parameter, like: composer install --no-scriptsDimond
@AndriiFilenko as a temporary solution it works. thanksSabrinasabsay
S
8

First: How I got the error:

  1. I have a symfony 4.2 installed application in a folder called my-project
  2. I copied the content of the project to another folder called my-App using CTRL-C then CTRL-V (copy-paste)
  3. I put it to my gitlab project
  4. My friend cloned the project and run Composer install and He got the Error "Script cache:clear returned with error code 255"

Second: How I solved this:

  1. Actually, when you make a CTRL-C and CTRL-V to the content of the symfony project folder, you are not copying everything, all the .files (dot files example .env, .test, .gitignore) are hidden.

  2. in order to copy the other hidden files such as .env you should open your terminal and type "cp .env (to your location)" in my case, it was "cp .env ~/Desktop/newApp"

Hint: in order to display all the folders and files in a folder use "ll" (ll: aliased to "ls -lh") instead of "ls" command.

Sabrinasabsay answered 25/2, 2019 at 13:22 Comment(1)
this solved it. and now i feel kinda stupid :DAnastos
B
3

In my case was that I removed some packages that I didn't need from the composer.json but I forgot to remove them from config/bundle.php.

So check config/bundle.php and if you find something there that isn't right, go delete it!

Bricabrac answered 30/6, 2020 at 22:30 Comment(0)
N
2

Downgraded temporarily from composer 2 to composer 1. Then I had this error after doing composer req symfony/orm-pack.

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
[...Stacktrace...]
!!  
Script @auto-scripts was called via post-update-cmd

Installation failed, reverting ./composer.json to its original content.

I had to remove @auto-scripts from my composer.json file. Not sure if this will lead to correct beahvior, but I was just followiing a tutorial.

Turn

        "post-update-cmd": [
            "@auto-scripts"
        ]

into

        "post-update-cmd": [
            ""
        ]
Nessy answered 3/9, 2021 at 20:6 Comment(0)
V
1

I have this error message but the problem was with cache being deleted, solve it with

console cache:warnup

Vaginal answered 8/11, 2021 at 17:36 Comment(0)
D
1

It happened to me too. Turns out my composer simply did not have enough memory available! Try this (it worked for me):

COMPOSER_MEMORY_LIMIT=-1 composer <your-composer-command-here>
Diena answered 12/1, 2023 at 13:41 Comment(0)
W
0

I just had this error message.

I removed the SwiftMailer bundle but not the config swiftMailer.yml file Symfony was unable to manage this configuration file

I solved this by removing the yml file

Winnebago answered 26/12, 2020 at 19:4 Comment(0)
S
0

I have had the same problem, in my case when installing symfony version 4 and 5.

Error:

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255

I solved it by downloading composer manually and running composer.phar :

php7.1 composer.phar create-project symfony/website-skeleton:"^4.4" symfony4

And now I have no problem installing symfony.

Scraggy answered 30/5, 2021 at 14:46 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.