You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1154:13)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/wangchengxiang/.config/yarn/global/node_modules/@rcpress/markdown/src/index.js:2:21)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14) {
code: 'ERR_REQUIRE_ESM'
}
貌似一部分是用commjs的,一部分是es6的模块功能
The text was updated successfully, but these errors were encountered:
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: