-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
照着官网运行直接报错 #37
Comments
node 版本v12.18.1 |
找到原因了,mdast-util-toc 6.0+只支持es module,可以暂时指定mdast-util-toc的版本为5.0+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wangchengxiang@wangchengxiang dxyer-v2-doc-repress % rcpress dev
internal/modules/cjs/loader.js:1154
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/wangchengxiang/.config/yarn/global/node_modules/mdast-util-toc/index.js
require() of ES modules is not supported.
require() of /Users/wangchengxiang/.config/yarn/global/node_modules/mdast-util-toc/index.js from /Users/wangchengxiang/.config/yarn/global/node_modules/@rcpress/markdown/src/index.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 /Users/wangchengxiang/.config/yarn/global/node_modules/mdast-util-toc/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/wangchengxiang/.config/yarn/global/node_modules/mdast-util-toc/package.json.
code: 'ERR_REQUIRE_ESM'
}
貌似一部分是用commjs的,一部分是es6的模块功能
The text was updated successfully, but these errors were encountered: