我目前正在从事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模块,但这无济于事。 任何人都和我有类似的问题吗?
答案 0 :(得分:3)
将@ angular / cli和@ angular / core更新到v7后,问题消失了。
Angular CLI:7.0.6 节点:8.9.4 操作系统:win32 x64 角度:7.1.0
答案 1 :(得分:1)
也有同样的问题,但就我而言,我无法升级有角度的cli或core,可能一切都会崩溃……我通过降级到
来解决它"ngx-bootstrap": "2.0.2"
先前使用的“ ngx-bootstrap”:“ ^ 3.2.0”也出现了这些相同的问题。感谢您的提示。