2015-03-25 47 views
6

我已經下載了一個基本的yii2應用程序。然後推入到git.But中,然後在其他電腦中使用作曲家安裝了所有依賴項。但是,我現在有涼亭文件夾,以便得到錯誤:在yii2基本應用程序的供應商文件夾中找不到Bower文件夾

The file or directory to be published does not exist: C:\xampp\htdocs\jumpbyte-site\vendor\bower/jquery/dist'

我composer.json文件有以下需要依賴:

"require": { 
     "php": ">=5.4.0", 
     "yiisoft/yii2": "*", 
     "yiisoft/yii2-bootstrap": "*", 
     "yiisoft/yii2-swiftmailer": "*", 
     "himiklab/yii2-sitemap-module": "*" 
    }, 
+0

你安裝'FXP /作曲家資產plugin'? – soju 2015-03-25 13:11:35

+0

不,我沒有安裝。這是什麼用途? – Ankita 2015-03-25 13:23:28

回答

12

要通過作曲管理亭子和NPM軟件包的依賴關係,你需要安裝(全球)fxp/composer-asset-plugin

composer global require "fxp/composer-asset-plugin:~1.1.1" 
composer install 

瞭解更多:http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-via-composer

+0

不要忘了在' – Footniko 2016-01-16 20:57:50

+0

之後使用'composer global require'fxp/composer-asset-plugin:〜1.0.0''你想確保你使用的是'composer global require 「fxp/composer-asset-plugin:〜1.1.1」' – 2016-03-26 00:58:52

4

先下載默認相關

composer global require "fxp/composer-asset-plugin:~1.0.3" 

然後只需運行

composer install 

然後重新加載您的網站。

0

(用於新鮮安裝) 在Windows上。

  1. 刪除窗口上的作曲家並重新安裝。 之後
  2. composer global require "fxp/composer-asset-plugin:~1.1.1"
  3. composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application

(用於更新): 除去上目錄的內容:

  1. 廠商刪除該文件
  2. composer.lock比
  3. composer install

這就是所有

1

轉到/vendor/yiisoft/yii2/base/Application.php。

轉到線456

變化

Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower');

Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower' . DIRECTORY_SEPARATOR . 'bower-asset');

+0

然後又是什麼?,絕不會更新作曲家或yii的整個人生。從不建議更改核心腳本 – 2016-05-11 16:49:41

1

這以後可能會碰壞,但這是不是試圖深挖作曲家問題快得多。我也嘗試過,無濟於事。我只是決定要給它它所要求的。

如果有人知道爲什麼這種解決方法不好,請說出來。

轉到/vendor/yiisoft/yii2/base/Application.php。

public function setVendorPath($path) 
{ 
    $this->_vendorPath = Yii::getAlias($path); 
    Yii::setAlias('@vendor', $this->_vendorPath); 
    Yii::setAlias('@bower', $this->_vendorPath . DIRECTORY_SEPARATOR . 'bower-asset'); //it was just 'bower' 
    Yii::setAlias('@npm', $this->_vendorPath . DIRECTORY_SEPARATOR . 'npm'); 
} 
0

就我而言,我有舊版本作曲家資產插件,並沒有正常工作。只有更新可以幫助我。因此,更新到作曲家資產插件的最新版本:

composer global require "fxp/composer-asset-plugin:^1.2.0"

^1.2.0。這一點很重要。

然後做這個命令:

rm -rf vendor/* 
rm composer.lock 
composer install 
相關問題