简体   繁体   English

发生未处理的异常:安装 ngx-bootstrap 时在 angular 中找不到模块

[英]An unhandled exception occurred: Cannot find module in angular while installing ngx-bootstrap

I want to use ngx-bootstrap so command for it is ng add ngx-bootstrap inside Angular project but I am getting error as:我想使用 ngx-bootstrap 所以命令是ng add ngx-bootstrap inside Angular 项目,但我收到错误:

An unhandled exception occurred: Cannot find module 'C:\Users\Nikhil\Desktop\angular-assignment2\node_modules@yarnpkg\lockfile\index.js'.发生未处理的异常:找不到模块“C:\Users\Nikhil\Desktop\angular-assignment2\node_modules@yarnpkg\lockfile\index.js”。 Please verify that the package.json has a valid "main" entry See "C:\Users\Nikhil\AppData\Local\Temp\ng-oquCOE\angular-errors.log" for further details.请验证 package.json 是否具有有效的“主”条目 有关详细信息,请参阅“C:\Users\Nikhil\AppData\Local\Temp\ng-oquCOE\angular-errors.log”。

It looks like you are using an invalid command to add the ngx-bootstrap module.看起来您正在使用无效命令来添加ngx-bootstrap模块。 The ng add command is only used for Angular CLI commands that involve adding new components, modules, or other Angular structures to your project. ng add命令仅用于涉及将新组件、模块或其他 Angular 结构添加到项目的 Angular CLI 命令。

To add an existing module from a third party using yarn :要使用yarn添加来自第三方的现有模块:

yarn add ngx-bootstrap

I fixed the problem with an unconventional way.我用一种非常规的方式解决了这个问题。 Uninstalling and reinstalling.卸载并重新安装。 In my case it was dependency with constants-browserify , and with npm uninstall constants-browserify and then npm install constants-browserify .在我的情况下,它依赖于constants- browserify ,并使用npm 卸载 constants- browserify 然后npm install constants-browserify I solved the error我解决了错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到模块“ngx-bootstrap” - Cannot find module 'ngx-bootstrap' ngx-bootstrap-找不到模块'ngx-bootstrap / component-loader' - ngx-bootstrap - Cannot find module 'ngx-bootstrap/component-loader' Angular:发生未处理的异常:找不到模块“webpack/lib/ParserHelpers” - Angular : An unhandled exception occurred: Cannot find module 'webpack/lib/ParserHelpers' angular:发生未处理的异常:找不到模块“webpack”? - angular: An unhandled exception occurred: Cannot find module 'webpack'? 发生未处理的异常:找不到模块'@schemics/angular/utility/project' - An unhandled exception occurred: Cannot find module '@schematics/angular/utility/project' 找不到模块“ngx-bootstrap”。 在 coreUI 模板中 - Cannot find module 'ngx-bootstrap'. in coreUI template 发生未处理的异常:找不到模块“./browsers”- - An unhandled exception occurred: Cannot find module './browsers' - angular ngx-bootstrap onClick警报模块 - angular ngx-bootstrap onClick on alert module 使用 Angular 14 安装 ngx-bootstrap 的问题(发现包“ngx-bootstrap”但不支持原理图) - an issue of installing ngx-bootstrap with Angular 14 (Package "ngx-bootstrap" was found but does not support schematics) Angular PWA:发生未处理的异常:找不到模块'@schematics/angular/utility' - Angular PWA: An unhandled exception occurred: Cannot find module '@schematics/angular/utility'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM