I am trying to install laravel 8 globally but it is installing version 4.1.1 every time. I use this code:
composer global require laravel/installer
Then i check version by writing this:
laravel -V
How can i install the latest version?
Note: it only happens when i install it globally
When you run composer global require laravel/installer it installs the Laravel Installer globally. The installers latest release is 4.1.1 - see Github releases
To create a new Laravel 8 project you need to run
$ laravel new example-app
after you installed the installer. Find these steps in the Laravel docs.
Determine the version
Option 1
Run php artisan --version in your folder where you installed your project.
Option 2
After you created your project you can go into the folder where you installed it, f. ex. example-app, and chech the file composer.json.
There you can find a require section with the packages laravel/framework telling you the correct version.
{
// ... other stuff
"require": {
// ... other packages
"laravel/framework": "^8.12",
}
}
You probably need to familiarize yourself with Composer and how package management works.
Related
I used this command for installing Laravel Installer:
composer global require "laravel/installer"
For creating a project I use :
laravel new name --jet
on 8th September laravel 8.x was released, and I'm looking for installing it using the laravel command but I couldn't do it. Instead, a new laravel project was created with Laravel 7.x. I need some help.
Note: I can create a project with Laravel 8.x with this command, but I need to update my required Laravel and make a project with laravel 8.x and jetstream by using the laravel command:
The Error looks like this.....
It will work
composer create-project --prefer-dist laravel/laravel laravel
composer require laravel/jetstream
php artisan jetstream:install inertia
/home/example_username/.config/composer go to this folder
and edit composer.json
and put
{
"require": {
"laravel/installer": "^4.0"
}
}
then run composer global update
Make sure to update your php version to >7.3 and latest Laravel Installer 4.0.3
composer global require laravel/installer
This might be helpful: https://laravel-news.com/reminder-update-your-laravel-installer
To see what version you have installed run laravel -V in your console
and if it’s less than v4.0 you’ll need to update, and we have a
tutorial on doing it, but typically it’s just a matter of running:
composer global require "laravel/installer:^4.0"
I tried to update my laravel/installer using the command:
composer global update laravel/installer
But it only upgraded its minor version (assuming that it uses Semantic Versioning).
Package operations: 0 installs, 1 update, 0 removals
- Updating laravel/installer (v2.1.0 => v2.3.0): Downloading (100%)
Then I execute the update command again:
composer global update laravel/installer
But outputs:
Nothing to install or update
I now uses PHP 7.4.4 (cli) obtained using php -v so I assume that it should be able to upgrade to latest which is Laravel Installer 3.0.1.
If running composer global update laravel/installer is not enough to upgrade the the desired version, there might be package dependencies that restricts the upgrade to the latest.
I do not know if there is a composer option to do that on global scope but the following commands works for me:
# uninstall the package
composer global remove laravel/installer
# reinstall
composer global require laravel/installer
The 1st process outputs the outdated packages dependencies that are removed with the laravel/installer package.
Then the 2nd process installs the latest laravel/installer with the updates dependencies.
Laravel documentation does not include how to update the installer package yet.
Update: Adding Documentation link on how to update a composer package.
composer require specific version documentation.
php composer.phar require "vendor/package:2.*" vendor/package2:dev-master
As we can see, specific version could be supplied after the colon.
https://getcomposer.org/doc/03-cli.md#require
your php version is restricting it.
it's probably because you have multiple PHP versions installed.
update your environment variable of PHP.
then remove The Laravel installer and install it again.
I have installed Composer on windows 7 with the Composer-Setup.exe.
I am trying to install Laravel via Composer on Windows 7. I've tried 2 different commands:
composer global require laravel/installer
and
composer create-project laravel/laravel blog --prefer-dist
but they don't work.
In the end, there always a message: "29 packages you are using are looking for funding"
When I type composer fund to find out, it says that:
Composer could not find a composer.json file in C:\Users\Administrators
Does any one have any solution or any useful link?
Your composer.json file have some packages which have paid licence. However composer do not prevent installing Laravel due to this.
As per logs Laravel has been successfully installed. Can you check at the destination folder.
Im trying to install the installation package from Typo3 with Composer but not the latest version. I need 9.5.
Do you know how can i do it with composer ?
installing the extension installs only the latest version. In the Webpage there´s a zip file but i dont know if i can use it with composer..
Thank you!
Just add the version you want to install as parameter to composer:
composer create-project typo3/cms-base-distribution my-new-project 9.5
You can try following :
composer require typo3/cms-introduction:4.0.1
Introduction package version 4.0.1 is compatible with TYPO3 9.5, you can check : https://extensions.typo3.org/extension/introduction/
You can use following:
e.g. in your composer.json
"require": {
"vendor/package": "1.3.2", // exactly 1.3.2
in your case:
{
"require": {
"typo3/cms": "9.5"
}
}
For more info on versioning, have a look at Composer - Version and Constraints
EDIT:
Error: When running a composer-based TYPO3 instance, it is not possible anymore to require the whole TYPO3 Core via composer require typo3/cms. This package is solely used for Core-development purposes from now on.
Instead, all system extensions maintained by the TYPO3 Core Team must be required individually.
Some examples:
composer require typo3/cms-core:^9
composer require typo3/cms-fluid-styled-content:^9
composer require typo3/cms-extbase:^9
composer require typo3/cms-workspaces:^9
composer require typo3/cms-sys-note:^9
For convenience, TYPO3 projects can simply require composer require typo3/minimal to get the main system extensions that are needed for a running TYPO3 instance, and add custom system extensions as mentioned above.
Impact:
Installing or updating the composer package typo3/cms will show an error for TYPO3 v9.
i.e. use:
{
"require": {
"typo3/minimal": "9.5"
}
}
Could not find package /laravel/laravel with stability stable.
So I've got that error when I tried to create new laravel project with the following command:
composer create-project --prefer-dist /laravel/laravel project
And if I try just laravel new project, I get:
laravel: command not found
However laravel is installed, and if I move to its installation folder (which is ~/.config/composer/vendor/laravel/installer), and I type:
php laravel new project
Then it works but I get bunch of * suggests installing *. For example:
laravel/framework suggests installing symfony/psr-http-message-bridge (Required to use psr7 bridging features (0.2.*).)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
And many more.
I'm on Linux Mint Cinnamon 64-bit, and LAMP.
Everything you need is covered in Laravel's extensive documentation.
Via Composer Create-Project
Alternatively, you may also install Laravel by issuing the Composer
create-project command in your terminal:
composer create-project --prefer-dist laravel/laravel blog
Note that there is no preceding slash in laravel/laravel.
For the installer to work, again you can refer to the documentation:
Via Laravel Installer
First, download the Laravel installer using Composer:
composer global require "laravel/installer" Make sure to place the
$HOME/.composer/vendor/bin directory (or the equivalent directory for
your OS) in your $PATH so the laravel executable can be located by
your system.
Once installed, the laravel new command will create a fresh Laravel
installation in the directory you specify. For instance, laravel new
blog will create a directory named blog containing a fresh Laravel
installation with all of Laravel's dependencies already installed:
laravel new blog
You can read more about changing your $PATH variable here