Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

composer - install new package without updating other packages

I added a package in the require block of my composer.json.

I do a composer install and it says Nothing to install or update.

In my understanding, composer update would work but I shouldn't do that because it updates the versions of the other packages to the latest, but I haven't tested my code on them.

How do I install that new package?

like image 452
Obay Avatar asked Jan 06 '23 11:01

Obay


1 Answers

The Command Line.

You don't have to add the new packages manually to your composer.json file and then do a composer install or update. Use The Command Line

Installing new packages from the command line automatically adds it to your composer.json file and it does not update previously installed packages.

From the project root, simply run:

composer require package/name

Hope it helps

like image 160
awoyotoyin Avatar answered Jan 11 '23 08:01

awoyotoyin