在Angular路由器中,模块构建失败。

27 浏览
0 Comments

在Angular路由器中,模块构建失败。

你好,我正在创建一个Angular项目,在创建项目后,当我输入ng s时,出现以下错误。我已经删除了node_modules并重新安装,创建了一个新的文件夹并重新尝试,但仍然出现相同的错误。请帮忙解决。提前感谢!

错误信息:

./node_modules/@angular/router/fesm2022/router.mjs - 错误:模块构建失败(来自./node_modules/@angular-devkit/build-angular/src/tools/babel/webpack-loader.js):
TypeError: E:\Downloads\SpringBootProjects\AngularNgPrime\client\node_modules\@angular\router\fesm2022\router.mjs:无法读取未定义的属性(正在读取'file')

package.json内容:

{

"name": "client",

"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": "^14.2.0",

"@angular/common": "^14.2.0",

"@angular/compiler": "^14.2.0",

"@angular/core": "^14.2.0",

"@angular/forms": "^14.2.0",

"@angular/platform-browser": "^14.2.0",

"@angular/platform-browser-dynamic": "^14.2.0",

"@angular/router": "^14.2.0",

"rxjs": "~7.5.0",

"tslib": "^2.3.0",

"zone.js": "~0.11.4"

},

"devDependencies": {

"@angular-devkit/build-angular": "^14.2.12",

"@angular/cli": "~14.2.12",

"@angular/compiler-cli": "^14.2.0",

"@types/jasmine": "~4.0.0",

"jasmine-core": "~4.3.0",

"karma": "~6.4.0",

"karma-chrome-launcher": "~3.1.0",

"karma-coverage": "~2.2.0",

"karma-jasmine": "~5.1.0",

"karma-jasmine-html-reporter": "~2.0.0",

"typescript": "~4.7.2"

}

}

0