有一个带有Angular CLI库的Angular CLI项目。该库是通过命令ng g library common
添加的。
库的构建工作正常,但是测试无法运行(命令ng test common
)。
Cannot locate node_modules directory.
Error: Cannot locate node_modules directory.
at Object.getCommonConfig (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/common.ts:39:11)
at KarmaBuilder._buildWebpackConfig (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/@angular-devkit/build-angular/src/karma/packages/angular_devkit/build_angular/src/karma/index.ts:163:7)
at Observable.rxjs_1.Observable.obs [as _subscribe] (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/@angular-devkit/build-angular/src/karma/packages/angular_devkit/build_angular/src/karma/index.ts:91:31)
at Observable._trySubscribe (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/Observable.ts:224:19)
at Observable.subscribe (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/Observable.ts:205:14)
at /Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/util/subscribeTo.ts:22:23
at Object.subscribeToResult (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/util/subscribeToResult.ts:25:29)
at MergeMapSubscriber._innerSub (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/operators/mergeMap.ts:145:5)
at MergeMapSubscriber._tryNext (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/operators/mergeMap.ts:138:10)
at MergeMapSubscriber._next (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/operators/mergeMap.ts:122:12)
at MergeMapSubscriber.Subscriber.next (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/Subscriber.ts:101:12)
at TapSubscriber._next (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/operators/tap.ts:116:22)
at TapSubscriber.Subscriber.next (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/Subscriber.ts:101:12)
at MergeMapSubscriber.notifyNext (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/operators/mergeMap.ts:159:22)
at InnerSubscriber._next (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
at InnerSubscriber.Subscriber.next (/Users/denis/Work/BackofficeApp3.0_dub/node_modules/rxjs/src/internal/Subscriber.ts:101:12)