小编Yor*_*ora的帖子

模块解析失败:标识符“?ngcc0”已声明为 ANGULAR

大家好,我正在做一个个人项目,但在使用时:\nimport {NgForm} from '@ angular / forms';\n出现错误,我尝试了“npm ci”命令,然后重新-安装node_modules,更新节点,但问题仍然存在。\n我在导入库时在app.module.ts中进行了相应的验证,但问题仍然存在。\n我非常感谢任何帮助、指导或建议

\n
Error: ./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js 27:12\nModule parse failed: Identifier '\xc9\xb5ngcc0' has already been declared (27:12)\nFile was processed with these loaders:\n * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js\n * ./node_modules/@ngtools/webpack/src/ivy/index.js\n\nYou may need an additional loader to handle the result of these loaders.\n|  */\n| import * as \xc9\xb5ngcc0 from '@angular/core';\n> import * as \xc9\xb5ngcc0 from '@angular/core';\n| const NG_VALUE_ACCESSOR = new InjectionToken('NgValueAccessor');\n|\n
Run Code Online (Sandbox Code Playgroud)\n

这些是我正在使用的依赖项:

\n
"dependencies": {\n    "@angular/animations": "~11.2.4",\n    "@angular/common": "~11.2.4",\n    "@angular/compiler": "~11.2.4",\n    "@angular/core": "~11.2.4",\n    "@angular/forms": "~11.2.4",\n    "@angular/platform-browser": "~11.2.4",\n    "@angular/platform-browser-dynamic": "~11.2.4",\n    "@angular/router": …
Run Code Online (Sandbox Code Playgroud)

node.js typescript webpack angular

0
推荐指数
1
解决办法
5190
查看次数

标签 统计

angular ×1

node.js ×1

typescript ×1

webpack ×1