前因:今天接手了前同事留给我的一个angular2项目,遇到了一个问题 ctorParameters.map is not a function ,由于博主不曾做过ng系列的项目,为了排查这个问题出现的位置及原因,这个问题花了我接近一天的时间去发现问题并解决了。。。代价重大,因此记录以防未来又碰到这个坑,出现这个问题的主要原因是dragula或ng-dragula依赖的版本与@angular依赖不匹配
解决:我接手的项目截图选中的@angular依赖版本都是2.2.0的,将以下截图中的@angular依赖都改成2.2.3,并且删除掉node_modules包,重新npm i(这是解决问题最快的方式了。。。),dragula(3.7.2)或ng-dragula(1.2.2)
本文是参考的github的解决方案:
https://github.com/valor-software/ng2-dragula/issues/496
To fix this quickly, use version 1.2.2-0
Basically this shouldn't happen with Semver.Meanwhile I tried it with an @angular 2.2.3 setup which was working pretty well. I also tried @angular 2.2.0 which caused the same error.