首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复在angular中运行compodoc时出现的错误?

如何修复在angular中运行compodoc时出现的错误?
EN

Stack Overflow用户
提问于 2021-03-24 04:16:07
回答 1查看 216关注 0票数 0

输入代码here>块引用

在angular (npx compodoc -p tsconfig.app.json src)中运行compodoc时出现下一个错误

我怎么才能修复它?

代码语言:javascript
复制
Ooops error during main graph generation, moving on next part with main graph disabled : : Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@aduh95/viz.js/sync/index.js
    require() of ES modules is not supported.
    require() of /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@aduh95/viz.js/sync/index.js from /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@compodoc/ngd-transformer/dist/engines/dot/dot.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
    Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /usr/local/lib/node_modules/@compodoc/compodoc/node_modules/@aduh95/viz.js/package.json.
EN

回答 1

Stack Overflow用户

发布于 2021-08-15 19:21:30

我也有同样的问题。我将Node版本从12.16.3更新到14.16.1,并修复了它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66770680

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档