0

我在我的项目中使用了Angular Tree 组件,在过去的几天里,我在构建 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
4

1 回答 1

4

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

更改了“@types/lodash”:“^4.14.119”,

到“@types/lodash”:“4.14.119”,

于 2020-09-05T12:50:49.747 回答