小编Pab*_*uza的帖子

错误 NG6002:出现在 AppModule 的 NgModule.imports 中,但无法解析为 NgModule 类

第一次使用 firestore 时出现此错误。根据我的研究,这似乎是 Ivy 的问题。我没有很多修改 tsconfig.app.json 的经验,这是我被指出的方向,遵循其他答案。

我能够从原始项目中修改的唯一一件事是使用 Angular Fire 6 而不是 5,这是我最初按照教程所做的。

这是 package.json:

{
  "name": "language",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.0.1",
    "@angular/cdk": "^9.0.0",
    "@angular/common": "~9.0.1",
    "@angular/compiler": "~9.0.1",
    "@angular/core": "~9.0.1",
    "@angular/fire": "^6.0.0-rc.1",
    "@angular/flex-layout": "^9.0.0-beta.29",
    "@angular/forms": "~9.0.1",
    "@angular/material": "^9.0.0",
    "@angular/platform-browser": "~9.0.1",
    "@angular/platform-browser-dynamic": "~9.0.1",
    "@angular/router": "~9.0.1",
    "firebase": "^7.8.2",
    "rxjs": "~6.5.4",
    "rxjs-compat": "^6.5.4",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": …
Run Code Online (Sandbox Code Playgroud)

angularfire angular google-cloud-firestore

164
推荐指数
12
解决办法
23万
查看次数

错误 TS1086:无法在 Angular 9 的环境上下文中声明访问器

我正在学习 Angular Material 并且在从“@angular/material/button”导入 { MatButtonModule } 时出现此错误。

从我在其他答案中读到的内容来看,它看起来像是包兼容性问题,但我无法修复它。

这是完整的错误

ERROR in node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context.
    node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(30,9): error TS1086: An accessor cannot be declared in an ambient context.
    node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(128,9): error TS1086: An accessor cannot be declared in an ambient context.
    node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(129,9): error TS1086: An accessor cannot be declared in an ambient context.
    node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(134,9): error TS1086: An accessor cannot be declared in an ambient context.
    node_modules/@angular/cdk/a11y/focus-trap/focus-trap.d.ts(135,9): error TS1086: An accessor cannot be declared …
Run Code Online (Sandbox Code Playgroud)

angular-material angular

46
推荐指数
2
解决办法
13万
查看次数

错误:找不到模块:错误:包路径 ./module 未从包 /node_modules/@angular/flex-layout Flex 布局导出

我在 SO 中遇到了类似的错误,但是在安装、删除 node-modules、package-lock.json 再次安装后,我仍然无法摆脱错误:

./src/app/app.module.ts:8:0-63 - 错误:找不到模块:错误:包路径 ./module 未从包 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules 导出/@angular/flex-layout (请参阅 /Users/pabs/FreeLance/Chris/Calculator/stamp/node_modules/@angular/flex-layout/package.json 中的导出字段)

{
  "name": "stamp",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~13.2.0",
    "@angular/cdk": "^13.2.3",
    "@angular/common": "~13.2.0",
    "@angular/compiler": "~13.2.0",
    "@angular/core": "~13.2.0",
    "@angular/flex-layout": "^13.0.0-beta.38",
    "@angular/forms": "~13.2.0",
    "@angular/material": "^13.2.3",
    "@angular/platform-browser": "~13.2.0",
    "@angular/platform-browser-dynamic": "~13.2.0",
    "@angular/router": "~13.2.0",
    "rxjs": "^6.6.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~13.2.3",
    "@angular/cli": "~13.2.3",
    "@angular/compiler-cli": …
Run Code Online (Sandbox Code Playgroud)

angular-flex-layout angular

6
推荐指数
1
解决办法
2万
查看次数

在 Visual Studio Code for Mac 上找不到类型或命名空间名称“System”

通过 VSCode 的源控制区域意外删除项目后,Omnisharp 完全停止工作。任何以前的项目和任何新创建的项目都不起作用。在 Visual Studio 上一切正常,所以我认为问题不在于 .NET Core 安装。我在 Mac 上。

在此处输入图片说明

    "message": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) [API, API, API]"

Run Code Online (Sandbox Code Playgroud)

我试过的:

  • 重新安装 .Net Core 3.1(无需先卸载)
  • 彻底删除VSCode(包括隐藏目录,缓存,一切)
  • 在网络上找到更简单的解决方案,例如重建、重启 omnisharp 等。

任何帮助表示赞赏,谢谢!

.net c# omnisharp .net-core visual-studio-code

2
推荐指数
1
解决办法
1644
查看次数