无法找到节点的导出名称(ButtonRadioGroupDirective 类...)

Der*_*rek 2 javascript ngx-bootstrap angular angular9

我正在学习 Udemy ( https://www.udemy.com/course/build-an-app-with-aspnet-core-and-angular-from-scratch )的课程,到目前为止,很好,直到我尝试安装 ngx-bootstrap 。

我安装npm install ngx-bootstrap --save在一个Angular9项目上,并ng build收到以下错误:

Compiling ngx-bootstrap : es2015 as esm2015

ERROR in Failed to find exported name of node (class ButtonRadioGroupDirective {
    constructor(cdr) {
        this.cdr = cdr;
        this.onChange = Function.prototype;
        this.onTouched = Function.prototype;
    }
    get value() {
        return this._value;
    }
    set value(value) {
        this._value = value;
    }
    writeValue(value) {
        this._value = value;
        this.cdr.markForCheck();
    }
    registerOnChange(fn) {
        this.onChange = fn;
    }
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
}) in 'C:/Dev/DatingApp/DatingApp-SPA/node_modules/ngx-bootstrap/bundles/ngx-bootstrap.es2015.js'.
Run Code Online (Sandbox Code Playgroud)

我遇到了以前的问题,我可以在这里找到解决方案:https : //github.com/valor-software/ngx-bootstrap/issues/5242

不确定它是否相关,但会分享以防万一:

ERROR in The target entry-point "ngx-bootstrap" has missing dependencies:
 - @angular/forms/src/directives/control_value_accessor
 - @angular/core/src/type
Run Code Online (Sandbox Code Playgroud)

感谢您的帮助!并让我知道我是否应该证明任何其他信息。

ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / ? \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.3
Node: 12.16.1
OS: win32 x64

Angular: 9.0.2
... animations, common, compiler, compiler-cli, core
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.3
@angular-devkit/build-angular     0.900.3
@angular-devkit/build-optimizer   0.900.3
@angular-devkit/build-webpack     0.900.3
@angular-devkit/core              9.0.3
@angular-devkit/schematics        9.0.3
@angular/cli                      9.0.3
@angular/forms                    9.0.5
@ngtools/webpack                  9.0.3
@schematics/angular               9.0.3
@schematics/update                0.900.3
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2
Run Code Online (Sandbox Code Playgroud)

Der*_*rek 8

这个问题的解决方案的版本号ngx-bootstrappackages.json的角项目文件。

"dependencies": {
     ...
     "ngx-bootstrap": "^5.5.0", // was "ngx-bootstrap": "^3.0.1",
    ...
},       
Run Code Online (Sandbox Code Playgroud)

设置ngx-bootstrap为最新解决了这个问题。

运行npm installng serve命令现在都在运行,没有相关错误,可以继续前进。