Angular js 1.6.9 测试未知提供者:$$taskTrackerFactoryProvider

Angular js 1.6.9 tests Unknown provider: $$taskTrackerFactoryProvider

由于回归风险,我的项目被迫在 1.6.9 中(例如,小写字母在 1.7 中已过时)。

但最近,我进行了 npm 更新,但我所有的 karma/phantomjs 测试都失败了,给

PhantomJS 2.1.1 (Windows 7.0.0)
Error: [$injector:unpr] Unknown provider: $$taskTrackerFactoryProvider <- $$taskTrackerFactory <- $browser <- $rootScope <- $browser
http://errors.angularjs.org/1.6.9$injector/unpr?p0=%24%24taskTrackerFactoryProvider%20%3C-%20%24%24taskTrackerFactory%20%3C-%20%24browser%20%3C-%20%24rootScope%20%3C-%20%24browser in C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify (line 8627)
c:/Users/XXX/AppData/Local/angular/angular.js:4887:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8627:86
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
c:/Users/XXX/AppData/Local/angular/angular.js:4892:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8632:48
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
injectionArgs@c:/Users/XXX/AppData/Local/angular/angular.js:5072:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8812:68
invoke@c:/Users/XXX/AppData/Local/angular/angular.js:5098:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8838:31
c:/Users/XXX/AppData/Local/angular/angular.js:4893:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8633:43
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
injectionArgs@c:/Users/XXX/AppData/Local/angular/angular.js:5072:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8812:68
invoke@c:/Users/XXX/AppData/Local/angular/angular.js:5098:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8838:31
$get@c:/Users/XXX/AppData/Local/angular/angular.js:4972:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8712:49
invoke@c:/Users/XXX/AppData/Local/angular/angular.js:5106:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8846:24
c:/Users/XXX/AppData/Local/angular/angular.js:4893:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8633:43
getService@c:/Users/XXX/AppData/Local/angular/angular.js:5047:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:8787:39
$$cleanup@c:/Users/XXX/AppData/Local/angular-mocks/angular-mocks.js:3281:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:3282:36
$$afterEach@c:/Users/XXX/AppData/Local/angular-mocks/angular-mocks.js:3253:0 <- C:/Users/XXX/AppData/Local/Temp/b99f75028e9c85bb8c30a356a1480903.browserify:3254:23

我的package.json(我删除了专有模块):

{
  "name": "XXX",
  "code": "XXX",
  "version": "1.0.0",
  "description": "XXX",
  "author": {
    "name": "XXX"
  },
  "devDependencies": {
    "angular-mocks": "^1.5.5",
    "browserify": "^13.3.0",
    "browserify-shim": "^3.8.12",
    "gulp": "^3.9.1",
    "yargs": "^6.0.0"
  },
  "dependencies": {
    "angular": "1.6.9",
    "angular-animate": "^1.5.5",
    "angular-sanitize": "~1.3.16",
    "angular-translate": "^2.7.0",
    "angular-ui-bootstrap": "^2.1.0",
    "angular-ui-router": "^0.3.0",
    "ng-device-detector": "^4.0.3"
  }
}

切换到 1.7.3 可以解决测试问题,但我的网站无法正常工作,在我解决第一个过时问题时需要进行完整的非回归测试

快速搜索结果不佳,显示 taskTrackerFactoryProvider 在 angular js 中出现 July 13th,但 npm 更新和 build/tests 在 7 月 24 日运行良好...

我想知道哪个模块可能调用 angular js 1.7 功能,尽管我提到我需要在我的 package.json

中使用 angular js 1.6

找到了,是angular-mocks。强制使用 1.6.9 版本,一切正常

感到震惊惊讶于 npm 无法管理它们之间的依赖关系,尤其是当一个 dep 需要另一个 dep 的特定功能时...