如何调试 ng bootstrap 包

How to debug ng bootstrap package

我正在尝试在 Angular 7 项目上调试 ng-bootstrap 4,所以我遵循了 this 克隆 ng-bootstrap 并使用 yarn 安装其依赖项的说明,该操作已完成且没有错误。之后,我转到我的 angular 项目并执行 npm install [path to ng-bootstrap] 并得到以下错误:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ng-bootstrap/ng-bootstrap@4.2.1 preinstall: `node misc/preinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ng-bootstrap/ng-bootstrap@4.2.1 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Rinaldi\AppData\Roaming\npm-cache\_logs19-08-08T02_15_19_801Z-debug.log

日志的尾部呈现相同的内容。我已经尝试删除 node_modules 并得到相同的结果。我如何克服这个错误?

再次重新安装所有内容,但使用 yarn 而不是 npm。将 jasmine 包添加到项目中并将 tsconfig.app.json 更改为以下代码。

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": ["jasmine"]
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.ts",  
    "./node_modules/@ng-bootstrap/ng-bootstrap/**/*.ts"
  ],
  "exclude": [
    "src/test.ts",
    "src/**/*.spec.ts",
    "test.ts",
    "**/*.spec.ts",
    "**/*.mock.ts"
  ]
}