file:///C:/Users/ruliu/OneDrive%20-%20Intel%20Corporation/Projects/PlanAppArchive/archive/archive/Cost/Cost/ACID/node_modules/@angular/compiler-cli/bundles/chunk-TGNYD6NI.js:2431 import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/compiler"; ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Named export 'CUSTOM_ELEMENTS_SCHEMA' not found. The requested module '@angular/compiler' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using: import pkg from '@angular/compiler'; const { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } = pkg; at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21) at async ModuleJob.run (node:internal/modules/esm/module_job:190:5) Node.js v18.16.0
时间: 2023-07-29 08:13:46 浏览: 150
这个错误信息显示在您的应用程序中使用了@angular/compiler模块的命名导出,但是这个模块是CommonJS模块,可能不支持所有的命名导出。解决这个问题的方法是,使用默认导出来导入模块,例如:
```js
import compiler from '@angular/compiler';
const { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } = compiler;
```
这种方法应该可以解决这个错误。
阅读全文