[英]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.