在 Angular 13 上构建我的应用程序时出现一些问题

发布于 2025-01-14 19:18:09 字数 3305 浏览 1 评论 0原文

我试图找到解决方案,关于这个问题...... 因为,不在我的代码中...... 它是在更新到最新的 npm 和 fs-extra 之后...

Build at: 2022-03-16T13:33:13.718Z - Hash: aeac85e5815ce0c4 - Time: 7748ms

Error: node_modules/@angular-devkit/build-angular/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.d.ts:26:121 - error TS2307: Cannot find module '../../.
./core/src' or its corresponding type declarations.

26 declare const _default: import("@angular-devkit/architect/src/internal").Builder<WebpackDevServerBuilderSchema & import("../../../core/src").JsonObject>;
                                                                                                                           ~~~~~~~~~~~~~~~~~~~


Error: node_modules/@angular-devkit/build-angular/node_modules/@angular-devkit/build-webpack/src/webpack/index.d.ts:30:116 - error TS2307: Cannot find module '../../../core/src'
 or its corresponding type declarations.

30 declare const _default: import("@angular-devkit/architect/src/internal").Builder<RealWebpackBuilderSchema & import("../../../core/src").JsonObject>;
                                                                                                                      ~~~~~~~~~~~~~~~~~~~


Error: node_modules/@angular-devkit/build-angular/node_modules/webpack-dev-middleware/types/index.d.ts:204:27 - error TS2694: Namespace '"fs"' has no exported member 'StatSyncFn
'.

204   statSync?: import("fs").StatSyncFn;



有人对此有类似的解决方案吗?... 我尝试重新安装 webpack-server,一切都表明...... 无事可做...我不明白为什么这不起作用... 如何继续...?

感谢我们的帮助...

此处为 package.json

  "name": "bonrefil",
  "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.0.0",
    "@angular/cdk": "^13.2.6",
    "@angular/common": "~13.0.0",
    "@angular/compiler": "~13.0.0",
    "@angular/core": "~13.0.0",
    "@angular/forms": "~13.0.0",
    "@angular/material": "^13.2.6",
    "@angular/platform-browser": "~13.0.0",
    "@angular/platform-browser-dynamic": "~13.0.0",
    "@angular/router": "~13.0.0",
    "bootstrap": "^5.1.3",
    "bootstrap-icons": "^1.7.2",
    "fs-extra": "^10.0.1",
    "image-to-base64": "^2.2.0",
    "jquery": "^3.6.0",
    "popper.js": "^1.16.1",
    "rxjs": "~7.4.0",
    "tslib": "^2.3.0",
    "uuid": "^8.3.2",
    "xdata": "^2.1.17",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.2.6",
    "@angular-devkit/core": "^13.2.6",
    "@angular/cli": "~13.0.3",
    "@angular/compiler-cli": "~13.0.0",
    "@nguniversal/builders": "^13.0.2",
    "@types/jasmine": "~3.10.0",
    "@types/jquery": "^3.5.9",
    "@types/node": "^12.20.46",
    "@types/uuid": "^8.3.4",
    "@types/webpack-dev-server": "^4.7.2",
    "bootstrapvalidator": "^0.5.4",
    "jasmine-core": "~3.10.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.4.3",
    "webpack": "^5.70.0",
    "webpack-dev-middleware": "^5.3.1",
    "webpack-dev-server": "^4.7.4"
  }
}

I try to found solutions, on this problem...
Because, is not on my code...
Its is after update to latest npm and fs-extra...

Build at: 2022-03-16T13:33:13.718Z - Hash: aeac85e5815ce0c4 - Time: 7748ms

Error: node_modules/@angular-devkit/build-angular/node_modules/@angular-devkit/build-webpack/src/webpack-dev-server/index.d.ts:26:121 - error TS2307: Cannot find module '../../.
./core/src' or its corresponding type declarations.

26 declare const _default: import("@angular-devkit/architect/src/internal").Builder<WebpackDevServerBuilderSchema & import("../../../core/src").JsonObject>;
                                                                                                                           ~~~~~~~~~~~~~~~~~~~


Error: node_modules/@angular-devkit/build-angular/node_modules/@angular-devkit/build-webpack/src/webpack/index.d.ts:30:116 - error TS2307: Cannot find module '../../../core/src'
 or its corresponding type declarations.

30 declare const _default: import("@angular-devkit/architect/src/internal").Builder<RealWebpackBuilderSchema & import("../../../core/src").JsonObject>;
                                                                                                                      ~~~~~~~~~~~~~~~~~~~


Error: node_modules/@angular-devkit/build-angular/node_modules/webpack-dev-middleware/types/index.d.ts:204:27 - error TS2694: Namespace '"fs"' has no exported member 'StatSyncFn
'.

204   statSync?: import("fs").StatSyncFn;



Somebody having like solutions on this ?...
I have try to re-install webpack-server, all indicated...
Nothing to do...I don't understound why that's not working...
How to proceed...?

Thanks to us for your help...

Here to package.json

  "name": "bonrefil",
  "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.0.0",
    "@angular/cdk": "^13.2.6",
    "@angular/common": "~13.0.0",
    "@angular/compiler": "~13.0.0",
    "@angular/core": "~13.0.0",
    "@angular/forms": "~13.0.0",
    "@angular/material": "^13.2.6",
    "@angular/platform-browser": "~13.0.0",
    "@angular/platform-browser-dynamic": "~13.0.0",
    "@angular/router": "~13.0.0",
    "bootstrap": "^5.1.3",
    "bootstrap-icons": "^1.7.2",
    "fs-extra": "^10.0.1",
    "image-to-base64": "^2.2.0",
    "jquery": "^3.6.0",
    "popper.js": "^1.16.1",
    "rxjs": "~7.4.0",
    "tslib": "^2.3.0",
    "uuid": "^8.3.2",
    "xdata": "^2.1.17",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^13.2.6",
    "@angular-devkit/core": "^13.2.6",
    "@angular/cli": "~13.0.3",
    "@angular/compiler-cli": "~13.0.0",
    "@nguniversal/builders": "^13.0.2",
    "@types/jasmine": "~3.10.0",
    "@types/jquery": "^3.5.9",
    "@types/node": "^12.20.46",
    "@types/uuid": "^8.3.4",
    "@types/webpack-dev-server": "^4.7.2",
    "bootstrapvalidator": "^0.5.4",
    "jasmine-core": "~3.10.0",
    "karma": "~6.3.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "~1.7.0",
    "typescript": "~4.4.3",
    "webpack": "^5.70.0",
    "webpack-dev-middleware": "^5.3.1",
    "webpack-dev-server": "^4.7.4"
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯狂的代价 2025-01-21 19:18:09

您需要更新您的@types/node 版本。如果您更新到至少 15.12.2,它现在应该可以工作:请参阅 https://app.renovatebot.com/package-diff?name=@types%2Fnode&from=13.13.5&to=15.12.2

You need to update your @types/node version. If you update to at least 15.12.2 it should now work: See https://app.renovatebot.com/package-diff?name=@types%2Fnode&from=13.13.5&to=15.12.2

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文