网上搜了好多答案,基本上都是让你在composer.json里面添加这样一段话:

   "extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower",
"npm-searchable": false,
"bower-searchable": false
}
}

因为自己也不是很清楚什么原因,我就如此这般的跟着操作,可是怎么弄都不行,依然会报同样的错! 刚学Yii2,好多东西都还不懂,遇到这样的问题真TM蛋疼,,,

折腾了好久,后来在官网上搜到了这样一段话,抱着试试看的心态,还真解决了!!

首先:假如你的项目名为myproject 在你的项目根目录里面使用composer(右键->Use Composer here)

我英语不好,下面就不在翻译,原文如下:

Step1:composer global require "fxp/composer-asset-plugin:1.0.*@dev"

Step2:composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced myproject

Step3:copy and past to composer.json at 'require', then run composer --prefer-dist update:

"bower-asset/jquery": "@stable",

"bower-asset/bootstrap": "@stable",

"bower-asset/jquery-ui": "@stable",

"bower-asset/jquery.inputmask": "@stable",

"bower-asset/punycode": "@stable"

Step4:Run composer --prefer-dist update

然后在浏览器中刷新项目,一切OK.

Yii2 composer更新后报错: Calling unknown method: yii\web\UrlManager::addRules()的更多相关文章

  1. YII2安装中遇到的错误解决Calling unknown method: yii\web\UrlManager::addRules()

    安装好YII2 后出现 例如以下图错误提示: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvenF0c3g=/font/5a6L5L2T/fontsize/ ...

  2. 执行composer install后报错:执行composer install后报错: d11wtq/boris v1.0.10 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.

    执行composer install后报错: d11wtq/boris v1.0.10 requires ext-pcntl * -> the requested PHP extension p ...

  3. Calling unknown method: app\modules\mobile\controllers\CompanyController::redirect()

    $this->redirect(['default/error']); Yii::$app->end();上边的代码出现 Calling unknown method: app\modul ...

  4. Yii2 给表添加字段后报错 Getting unknown property

    手动在数据库中添加了image字段 然后再模型类Image中的 rule方法也将image的验证规则放进去了 但是在 $model = new Image 后,使用$model->iamge 还 ...

  5. Yii2 使用json 和设置component 中'format' => yii\web\Response::FORMAT_JSON 的区别

    在Yii2中如果设置了 'response' => [  'format' => yii\web\Response::FORMAT_JSON,  'charset' => 'UTF- ...

  6. YII2 composer update 报错解决一例-requires bower-asset/jquery 2.2

    ➜  yii-advanced composer update Loading composer repositories with package information Updating depe ...

  7. openstack kilo compute更新后报错IncompatibleObjectVersion: Version 1.2 of PciDeviceList is not supported

    前几天在compute节点更新openstack的包后,发现报错IncompatibleObjectVersion: Version 1.2 of PciDeviceList is not suppo ...

  8. 【bug】【yii】配置log时,报错 Setting read-only property: yii\web\Application::log

    Setting read-only property: yii\web\Application::log 配置放在了 components 外面,应该放在里面

  9. 更新Composer依赖报错处理Fatal error: Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRe

    更新Composer依赖报错处理 Fatal error: Declaration of Fxp\Composer\AssetPlugin\Repository\AbstractAssetsRe po ...

随机推荐

  1. 怒刷DP之 HDU 1160

    FatMouse's Speed Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Su ...

  2. 公用的stringUtil工具

    (function(){ var ISCHINESE = /[\u4e00-\u9fa5]/; var getData = function( value , maxLenth , isStrick ...

  3. 跟我学习dubbo-使用Maven构建Dubbo服务的可执行jar包(4)

    Dubbo服务的运行方式: 1.使用Servlet容器运行(Tomcat.Jetty等)----不可取 缺点:增加复杂性(端口.管理) 浪费资源(内存) 官方:服务容器是一个standalone的启动 ...

  4. ASP.NET MVC 4 SimpleMembership Provider (1)

    新的ASP.NET MVC 4.0 提供了一个新的Membership Provider,叫SimpleMembership. 首先,我们建立一个新的solution 首先我们先看一下web.conf ...

  5. 运用DataTable进行行转列操作

    public DataTable GetReverseTable(DataTable p_Table) { DataTable _Table = new DataTable(); ; i != p_T ...

  6. [Fiddler]Unable to Generate Certificate

    I'm using Fiddler2 (or trying) to capture SSL traffic for a windows desktop gadget hitting an https ...

  7. CI框架程序--本地调试之后部署新浪SAE

    前几天给朋友写了个简单的网站, 想想还是部署到服务器上让朋友看一下效果! 用CI框架写的,有个SAE新浪云的账号,可以用!就部署到上面去了!途中遇到了一些问题!一一解决了! 在这里分享一下 供遇到这些 ...

  8. 使用script的src实现跨域和类似ajax效果

    在解决js的跨域问题的时候, 有多种方式, 其中有一种是利用script标签的src属性,因为这个属性是不受域名限制的,我们可以直接让src的这个链接指向跨域网站的一个接口, 这个接口返回的是js代码 ...

  9. python:笔记for循环中的else

    我们常常会在for循环遍历一个序列或者字典后,接着语句else,很多新手会误以为是判断执行else后面的 代码,其实不然,for循环里面也不存在判断,而已执行完遍历的对象后,再执行else后面的代码. ...

  10. 【leetcode】368. Largest Divisible Subset

    题目描述: Given a set of distinct positive integers, find the largest subset such that every pair (Si, S ...