构建在 Angular 树组件失败并显示消息 "no exported member 'Cancelable'"

Build fails at Angular Tree component with message "no exported member 'Cancelable'"

我在我的项目中使用 Angular Tree Component,在过去的几天里,我在构建 Angular 应用程序时遇到以下错误。经过一场安静的斗争,这个问题得到了解决。我在下面为社区发布我的答案。

2020-09-02T13:10:19.5809754Z ERROR in node_modules/angular-tree-component/dist/components/tree-viewport.component.d.ts(3,10): error TS2305: Module '"D:/eb/A3322/work/2/s/node_modules/@types/lodash/index"' has no exported member 'Cancelable'.
2020-09-02T13:10:19.5810790Z 
2020-09-02T13:10:19.7050898Z npm ERR! code ELIFECYCLE
2020-09-02T13:10:19.7053154Z npm ERR! errno 1

最新版本的 loadash (4.14.161) 有重大变化。坚持使用低于 161 的版本,一切都会奏效。 Angular-tree-component 在内部使用 lodash。我的 lodash 版本有一个上限,它会自动更新组件,使其更难找到。

已更改 "@types/lodash": "^4.14.119",

到 "@types/lodash": "4.14.119",