powershell composer ^ vs ~

I don't know where to land this officially. This is a way to use the ^ within powershell (not my credits though) Is that something we want to improve in the documentation?
composer require filament/filament:"^4.0" -W --no-update
composer require filament/filament:"^4.0" -W --no-update
run below command: (put single quotes around the double quotes)
composer require filament/filament:'"^4.0"' -W --no-update
composer require filament/filament:'"^4.0"' -W --no-update
Solution:
It also affected the upgrade script, but the PR itself was for the docs.
Jump to solution
10 Replies
Dennis Koch
Dennis Koch7d ago
We tried them all. There is no way that works properly in all Windows shells.
HenkN
HenkNOP6d ago
https://filamentphp.com/docs/4.x/introduction/installation refers to use the ~ only for windows in combination with powershell. In the command prompt under windows I can use the normal notation. Are there also powershell shells on windows that does not "consume" the caret?
Dennis Koch
Dennis Koch6d ago
Yes, the standard CMD shell
Dennis Koch
Dennis Koch6d ago
GitHub
Docs: v4 Installation on Windows by pxlrbt · Pull Request #16462 ...
The caret ^ is used as an escape character in Powershell. No quoting helps. The tilde works though and is almost similar in semantics. ~4.0 will allow updated until 5.0.
HenkN
HenkNOP6d ago
the PR refers to the update script that cannot detect correctly the shell (if I am reading this correct). I was talking about improvement of the documentation on the site. where you we can also mention that if you run the command with
--no-update
--no-update
composer will complain (or not)
Solution
Dennis Koch
Dennis Koch6d ago
It also affected the upgrade script, but the PR itself was for the docs.
HenkN
HenkNOP6d ago
the required action will be wrong in the script output. only the site can be "fixed" or we can put there a sidenote for this double quote solution
Dennis Koch
Dennis Koch6d ago
only the site can be "fixed" or we can put there a sidenote for this double quote solution
Not sure what you mean? You want to add another note? I guess that will get a bit confusing.
HenkN
HenkNOP6d ago
There are maybe more dependency's and complications than I can probably oversee as beginner. I tried the workaround with the double quotation and it works for me in powershell and I was wondering (with proposing a solution ) why this was not on the site. Just keep it as a ~ and you can change the composer.json manually to ^ is also valid way to workaround
Dennis Koch
Dennis Koch6d ago
You can use that way. It's just too complicated to explain all the options for different shells 😅

Did you find this page helpful?