[![enter image description here](https://i.stack.imgur.com/PKlCN.png)](https://i.stack.imgur.com/PKlCN.png)I am using yii2 framework since last few weeks. But now I am getting some issues with composer itself.

Just for info, I am using ubuntu 14.04

When I require some new package / extensions, I do the composer add by using composer require command. But I noticed that sometimes it's removing few of the existing packages from my vendor and project.

I tried with following commands.

```
composer require dmstr/yii2-adminlte-asset "*"

composer require 2amigos/yii2-file-upload-widget:~1.0

```

And also tried with some googling.

<http://www.yiiframework.com/wiki/672/install-specific-yii2-vendor-extension-dependency-without-updating-other-packages/>

But it's not working.

Is there a way to add a new package / extension into your existing yii 2 project without removing existing packages or without any composer update command?

**Composer.json**

```
{
    "name": "sganz/yii2-advanced-api-template",
    "description": "Improved Yii 2 Advanced Application Template By Sandy Ganz, Original by Nenad Zivkovic",
    "keywords": ["yii2", "framework", "advanced", "improved", "application template", "nenad", "sganz"],
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "tutorial": "http://www.freetuts.org/tutorial/view?id=6",
        "source": "https://github.com/sganz/yii2-advanced-api-template.git"
    },
    "minimum-stability": "dev",
    "prefer-stable":true,
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "nenad/yii2-password-strength": "*",
        "mihaildev/yii2-ckeditor": "*",
        "dmstr/yii2-adminlte-asset": "*"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*",
        "codeception/specify": "*",
        "codeception/verify": "*"
    },
    "config": {
        "vendor-dir": "protected/vendor",
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "protected/vendor/npm",
            "bower-asset-library": "protected/vendor/bower"
        }
    }
}

```

Any help on this would be greatly appreciated.
['https://Stackoverflow.com/questions/39099218', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6608101/']
Try

```
composer --no-update require dmstr/yii2-adminlte-asset:*

```
I had this problem few days ago to install a package but when I installed the package all the project updated and my project became broken.So I replace my last vendor again,So I found a safe way for better and safer upgrading packages:

1. archiving your vendor to a zip or rar file and copy composer.json too.
2. add package to composer or install with composer require.
3. dont clear command line screen and copy its screen into a txt file to find versions
4. find your vital and main packages like yiisoft/yii2 and .... and copy their versions.  

for doing this open txt file and search in upgrade lines and find something like below:  

`- Upgrading yiisoft/yii2 (2.0.39.3 => 2.0.41.1): Extracting archive` means that your current version is 2.0.39.3,so copy this version on composer.json like below:*(without ~ and ^)*  

`"yiisoft/yii2": "2.0.39",`
5. remove project vendor folder and extract backup vendor and finally run
`composer install` or `composer update`.

***note:*** dont remove vendor and composer.json backup till your project will works correctly then you can remove them.  

\**this is a manually way for upgrading vendors for don't upgrade in vital framework updates temporary like for my project update that yii released Yii2.0.41.*  

**a very important note is from yii upgrade notes from [here](https://github.com/yiisoft/yii2/blob/2.0.41/framework/UPGRADE.md) that:**

> 
> Note: This document assumes you have composer installed globally so that you can run the composer command. If you have a composer.phar file inside of your project you need to replace composer with php composer.phar in the following.
> 
> 
> Tip: Upgrading dependencies of a complex software project always comes at the risk of breaking something, so make sure you have a backup (you should be doing this anyway ;) ).
> 
> 
> 

so running `composer update` command directly could break part of your application like me that my admin pannel was broken.

good luck ;)