类<MyModule>不是Angular模块

问题描述

我以这种方式导入了一个模块:

@NgModule({
   imports: [
      ...
      <MyModule>.forRoot(),...     
   ],...
})

我正在使用

  • 角度:10.1.0-next.4
  • 节点v10.22.0
  • npm 6.14.6

为了避免干扰,我卸载了其他版本。

我的package.json具有以下依赖项:

  "dependencies": {
    "@angular/animations": "~10.1.0-next.3","@angular/cdk": "^10.1.3","@angular/common": "~10.1.0-next.3","@angular/compiler": "~10.1.0-next.3","@angular/core": "^10.1.0-next.3","@angular/forms": "~10.1.0-next.3","@angular/platform-browser": "~10.1.0-next.3","@angular/platform-browser-dynamic": "~10.1.0-next.3","@angular/router": "~10.1.0-next.3",**"@<my_group>/<my_lib>": "^1.0.0-ng10-alpha.3",** --> CONTAINS <MY_MODULE>
    "@ng-select/ng-select": "^5.0.0","@ngx-translate/core": "^13.0.0","@ngx-translate/http-loader": "^6.0.0","bootstrap": "^4.5.2","file-saver": "^2.0.2","filesize": "^6.1.0","font-awesome": "^4.7.0","mdn-polyfills": "^5.20.0","ngx-bootstrap": "^5.6.1","rxjs": "~6.6.0","tslib": "^2.0.0","zone.js": "~0.10.2"
  },"devDependencies": {
    "@angular-devkit/build-angular": "~0.1001.0-next.3","@angular/cli": "~10.1.0-next.3","@angular/compiler-cli": "~10.1.0-next.3","@types/node": "^12.11.1","@types/jasmine": "~3.5.0","@types/jasminewd2": "~2.0.3","codelyzer": "^6.0.0","jasmine-core": "~3.6.0","jasmine-spec-reporter": "~5.0.0","karma": "~5.0.0","karma-chrome-launcher": "~3.1.0","karma-coverage-istanbul-reporter": "~3.0.2","karma-jasmine": "~3.3.0","karma-jasmine-html-reporter": "^1.5.0","protractor": "~7.0.0","ts-node": "~8.3.0","tslint": "~6.1.0","typescript": "~3.9.5"
  }

这是另一个人使用的软件包,可以运行该应用程序而不会出现错误消息,也无需代码中的不是Angular模块注释,他也使用了节点10(我以前使用的是12,但是我尝试切换到10)。

以下是另一个问题,我重新安装了ng和node,现在启动时显示

ERROR in C:/Users/Antonino/node_modules/ngx-bootstrap/positioning/fesm2015/ngx-bootstrap-positioning.js
Module not found: Error: Can't resolve '@angular/common' in 'C:\Users\Antonino\node_modules\ngx-bootstrap\positioning\fesm2015'

ERROR in C:/Users/Antonino/node_modules/ngx-bootstrap/positioning/fesm2015/ngx-bootstrap-positioning.js
Module not found: Error: Can't resolve '@angular/core' in 'C:\Users\Antonino\node_modules\ngx-bootstrap\positioning\fesm2015'

ERROR in C:/Users/Antonino/node_modules/ngx-bootstrap/utils/fesm2015/ngx-bootstrap-utils.js
Module not found: Error: Can't resolve '@angular/core' in 'C:\Users\Antonino\node_modules\ngx-bootstrap\utils\fesm2015'

ERROR in C:/Users/Antonino/node_modules/ngx-bootstrap/positioning/fesm2015/ngx-bootstrap-positioning.js
Module not found: Error: Can't resolve 'rxjs' in 'C:\Users\Antonino\node_modules\ngx-bootstrap\positioning\fesm2015'
** Angular Live Development Server is listening on localhost:4200,open your browser on http://localhost:4200/ **
Error from chokidar (C:\): Error: EBUSY: resource busy or locked,lstat 'C:\hiberfil.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked,lstat 'C:\pagefile.sys'
Error from chokidar (C:\): Error: EBUSY: resource busy or locked,lstat 'C:\swapfile.sys'

我知道我应该安装npm core来删除该消息,但是我有

 "@angular/core": "^10.1.0-next.3",

为什么看不到他们?

我运行了 npm install

您有什么建议吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)