Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Can't install #784

Closed
ceszgdav opened this issue Jun 11, 2021 · 27 comments
Closed

Can't install #784

ceszgdav opened this issue Jun 11, 2021 · 27 comments

Comments

@ceszgdav
Copy link

When I try to isntall in my laravel project this throw me a error

image

how can i fix this?

@WahidinAji
Copy link

hi @ceszgdav, is this already solved?

@ceszgdav
Copy link
Author

ceszgdav commented Jul 2, 2021

Hi!, Not yet. The problem is, Is not compatible with the actually versión of pusher just with 5.0 or less

@WahidinAji
Copy link

different in my case, i installed laravel 7, and it's working fine. idk in laravel 8, some package's not supported.

@ceszgdav
Copy link
Author

ceszgdav commented Jul 2, 2021

Probably Is that the problem because i'm using laravel 8. Need to check that. 🤔

@WahidinAji
Copy link

WahidinAji commented Jul 3, 2021

hahaha i solved the problem bro,

  • firts i changed this line, from 8.49.1 to v8.14.0

image

  • and then, i changed this. from 9 to 8, idk why by default if we installed the latest laravel we got 9 version.

image

  • and this too, from ^1.7 || ^2.0 to ^1.7

image

  • and this, fromt 2.0.0 to 1.7.0

image

and then , i changed my composer.json too in this line, from ^8.40 to 8.12,

image

@stayallive
Copy link
Contributor

You should not mess in the composer.lock file. The fix is simple:

composer require "pusher/pusher-php-server:^5.0" "beyondcode/laravel-websockets:^1.12"

The problem is that Pusher has released version 6 & 7 of their PHP SDK and that is not compatible with Laravel Websocket 1.x so the solution is to install the Pusher SDK version 5 first.

Once 2.x is released this might change but for 1.x this is the solution :)

@WahidinAji
Copy link

i try, but still not working.
image

i try to install pusher first, but if i try to install laravel/web-sockets. it's still not working for me.?
image

@stayallive
Copy link
Contributor

stayallive commented Jul 5, 2021

Yeah I have not figure out how to fix this using the composer CLI tool...

But the easiest way is to add these 2 lines to the require section of your composer.json:

	// ... rest of the composer file
    "require": {
		// ... other dependencies
        "beyondcode/laravel-websockets": "^1.12",
        "pusher/pusher-php-server": "^5.0"
	},

And make sure to remove any duplicate lines if beyondcode/laravel-websockets & pusher/pusher-php-server was already present in your require section.

And after you've made the changes run composer update which should work (this time:tm:).

@WahidinAji
Copy link

if i updated using composer update some package has errors. but, a minutes ago i try to install again. and ya, i'm just changed this line to 1.7.0
image

and then i installed composer require pusher/pusher-php-server:^5.0, and its worked. no more changes some package version, like what i descript in above. and i have a question, this's bug is from laravel-websockets or pusher? or both?

thanks before,

@stayallive
Copy link
Contributor

There is no bug, it just has to do with dependencies and their version. When you run composer require some/package composer will not downgrade existing packages which causes some errors because the packages already installed are too new.

So adding them to the composer.json manually and running composer update generally fixes it since it then is allowed to downgrade, there is probably some CLI parameter you can add to composer require to fix that but I have not figured it out yet 😄

@WahidinAji
Copy link

ohh sorry hahaha, nice info. i try it later, thanks mate.

but maybe this issue is/can closed.

@stanliwise
Copy link

Guzzle/psr7 is the root cause of the problem you're facing and I don't subscribe to people manually changing the version in composer file, except you know what you're doing.

use this command to downgrade.

composer require "guzzlehttp/psr7:^1.7"

This was referenced Sep 15, 2021
@alexhackney
Copy link

alexhackney commented Oct 5, 2021

I solved installing on a fresh laravel 8 with these commands

composer require "guzzlehttp/psr7:^1.7"
composer require "pusher/pusher-php-server:^5.0"
composer require beyondcode/laravel-websockets

Hoping the wonderful people at beyond code update this package!

I'm setting this up as an independent micro service, so I don't think it's going to cause any issues to run this way but I would be concerned if this was a full app.

@crossRT
Copy link

crossRT commented Oct 13, 2021

Thanks @alexhackney .

For me, I solved it by installing some packages with these commands

composer require "guzzlehttp/psr7:^1.7"
composer require "psr/log:1.1.4"
composer require beyondcode/laravel-websockets

I'm doing these in sail.

@briantuju
Copy link

I solved installing on a fresh laravel 8 with these commands

composer require "guzzlehttp/psr7:^1.7"
composer require "pusher/pusher-php-server:^5.0"
composer require beyondcode/laravel-websockets

Hoping the wonderful people at beyond code update this package!

I'm setting this up as an independent micro service, so I don't think it's going to cause any issues to run this way but I would be concerned if this was a full app.

This works on laravel 8.65.

As for the pusher/pusher-php-server you can use the --with-all-dependencies or -W flag if it fails to install

@TomatoPana
Copy link

I solved installing on a fresh laravel 8 with these commands

composer require "guzzlehttp/psr7:^1.7"
composer require "pusher/pusher-php-server:^5.0"
composer require beyondcode/laravel-websockets

Hoping the wonderful people at beyond code update this package!
I'm setting this up as an independent microservice, so I don't think it's going to cause any issues to run this way but I would be concerned if this was a full app.

This works on laravel 8.65.

As for the pusher/pusher-php-server you can use the --with-all-dependencies or -W flag if it fails to install

When running composer require "guzzlehttp/psr7:^1.7 -W" on a fresh install of laravel 8.65 throws me an error saying this:

Problem 1    
    - guzzlehttp/guzzle is locked to version 7.4.0 and an update of this package was not requested.
    - guzzlehttp/guzzle 7.4.0 requires guzzlehttp/psr7 ^1.8.3 || ^2.1 -> found guzzlehttp/psr7[dev-master, 1.8.3, 1.x-dev, 2.1.0, 2.1.x-dev (alias of dev-master)] but it conflicts with your root composer.json require (1.7).

Downgrading guzzlehttp/guzzle:7.3.0 the latest version that supports guzzlehttp/psr7:^1.7 solved the problem, but I don't know if that is the case breaks some functionality.

@aoeng
Copy link

aoeng commented Nov 13, 2021

hi ,socket ,can you dependency psr7:^2?

@Developer-Nasim
Copy link

Developer-Nasim commented Dec 29, 2021

just use these then I think it will be fix cause I tried and it's working as well

      "beyondcode/laravel-websockets": "^1.12",
        "pusher/pusher-php-server": "^4.0"

@muneeburrehmanweb
Copy link

Thanks @alexhackney .

For me, I solved it by installing some packages with these commands

composer require "guzzlehttp/psr7:^1.7"
composer require "psr/log:1.1.4"
composer require beyondcode/laravel-websockets

I'm doing these in sail.

thanks a lot. my problem is solved

@vatsal-ajmera
Copy link

vatsal-ajmera commented Jun 27, 2023

You can also try

composer require beyondcode/laravel-websockets -w

to install beyondcode in your laravel 10 project

I also using Laravel 10 to websocket Integration and this works fine for me.

@mmejaz
Copy link

mmejaz commented Aug 8, 2023

You can also try

composer require beyondcode/laravel-websockets -w

to install beyondcode in your Laravel 10 project

I also use Laravel 10 to WebSocket Integration and this works fine for me.

ye this is also working for me (-w flag means with all dependencies)

@bishal221973
Copy link

Just run this command
composer require beyondcode/laravel-websockets -w

@MuhamadMwaas
Copy link

the broblem is php version php8.1 not supported in laravel-websocket

@qeba
Copy link

qeba commented Oct 5, 2023

when this can support php8.1?. or i can just use the command
composer require beyondcode/laravel-websockets -w

should be fine?

@abbashaider99
Copy link

I had same problem after searching I found this youtube video that explains how to install beyondcode laravel web socket on laravel 10. It's working perfectly.

composer require beyondcode/laravel-websockets -w

Video Link: https://youtu.be/8RL584c7EsI

@DALIA000
Copy link

DALIA000 commented Dec 5, 2023

composer require beyondcode/laravel-websockets -w --ignore-platform-req=ext-sodium

@eserranda
Copy link

You can also try

composer require beyondcode/laravel-websockets -w

to install beyondcode in your laravel 10 project

I also using Laravel 10 to websocket Integration and this works fine for me.

Thanks, work for me, i'm using laravel 10

@mpociot mpociot closed this as completed Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests