ngx-bootstrap - 找不到模块'ngx-bootstrap / component-loader'

问题描述 投票:2回答:2

我目前正在开发Angular CLI应用程序。几个小时前我完成了一些部分,关闭项目,现在我想再次运行项目以继续我的工作。但是,而不是成功项目编译我在ngx-bootstrap模块上得到错误。

    ERROR in node_modules/ngx-bootstrap/dropdown/bs-dropdown.directive.d.ts(2,40): error TS2307: Cannot find module 'ngx-bootstrap/component-loader'.
node_modules/ngx-bootstrap/dropdown/bs-dropdown.state.d.ts(2,32): error TS2307: Cannot find module 'ngx-bootstrap/component-loader'.
node_modules/ngx-bootstrap/public_api.d.ts(2,26): error TS2307: Cannot find module 'ngx-bootstrap/utils'.
node_modules/ngx-bootstrap/public_api.d.ts(3,95): error TS2307: Cannot find module 'ngx-bootstrap/accordion'.
node_modules/ngx-bootstrap/public_api.d.ts(4,58): error TS2307: Cannot find module 'ngx-bootstrap/alert'.
node_modules/ngx-bootstrap/public_api.d.ts(5,78): error TS2307: Cannot find module 'ngx-bootstrap/buttons'.
node_modules/ngx-bootstrap/public_api.d.ts(6,83): error TS2307: Cannot find module 'ngx-bootstrap/carousel'.
node_modules/ngx-bootstrap/public_api.d.ts(7,51): error TS2307: Cannot find module 'ngx-bootstrap/collapse'.
node_modules/ngx-bootstrap/public_api.d.ts(8,284): error TS2307: Cannot find module 'ngx-bootstrap/datepicker'.
node_modules/ngx-bootstrap/public_api.d.ts(9,133): error TS2307: Cannot find module 'ngx-bootstrap/modal'.
node_modules/ngx-bootstrap/public_api.d.ts(11,107): error TS2307: Cannot find module 'ngx-bootstrap/pagination'.
node_modules/ngx-bootstrap/public_api.d.ts(12,90): error TS2307: Cannot find module 'ngx-bootstrap/progressbar'.
node_modules/ngx-bootstrap/public_api.d.ts(13,47): error TS2307: Cannot find module 'ngx-bootstrap/rating'.
node_modules/ngx-bootstrap/public_api.d.ts(14,102): error TS2307: Cannot find module 'ngx-bootstrap/sortable'.
node_modules/ngx-bootstrap/public_api.d.ts(15,117): error TS2307: Cannot find module 'ngx-bootstrap/tabs'.
node_modules/ngx-bootstrap/public_api.d.ts(16,73): error TS2307: Cannot find module 'ngx-bootstrap/timepicker'.
node_modules/ngx-bootstrap/public_api.d.ts(17,91): error TS2307: Cannot find module 'ngx-bootstrap/tooltip'.
node_modules/ngx-bootstrap/public_api.d.ts(18,116): error TS2307: Cannot find module 'ngx-bootstrap/typeahead'.
node_modules/ngx-bootstrap/public_api.d.ts(19,91): error TS2307: Cannot find module 'ngx-bootstrap/popover'.
node_modules/ngx-bootstrap/public_api.d.ts(20,146): error TS2307: Cannot find module 'ngx-bootstrap/utils'.
node_modules/ngx-bootstrap/public_api.d.ts(21,85): error TS2307: Cannot find module 'ngx-bootstrap/component-loader'.
node_modules/ngx-bootstrap/public_api.d.ts(22,87): error TS2307: Cannot find module 'ngx-bootstrap/positioning'.
node_modules/ngx-bootstrap/public_api.d.ts(25,15): error TS2307: Cannot find module 'ngx-bootstrap/locale'.

我试图安装ngx-bootstrap模块,但这没有帮助。有没有像我一样的问题?

angular ngx-bootstrap
2个回答
3
投票

更新@ angular / cli和@ angular / core到v7之后,问题就消失了。

Angle CLI:7.0.6节点:8.9.4 OS:win32 x64 Angular:7.1.0


1
投票

刚出现同样的问题,但在我的情况下,我无法升级角度cli或核心,可能一切都会崩溃......我通过降级来修复它

"ngx-bootstrap": "2.0.2"

之前使用过的“ngx-bootstrap”:“^ 3.2.0”也造成了同样的问题。谢谢你提示。

© www.soinside.com 2019 - 2024. All rights reserved.