I’m using a theme ‘Edition’ and I want to customize it for my blog.
I submitted ‘yarn dev’ on command line.
I saw this error message.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/myname/myproeject/ghost-blog/content/themes/edition/node_modules/beeper/index.js
require() of ES modules is not supported.
require() of /Users/myname/myproject/ghost-blog/content/themes/edition/node_modules/beeper/index.js from /Users/myname/myproject/ghost-blog/content/themes/edition/gulpfile.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 /Users/myname/myproject/ghost-blog/content/themes/edition/node_modules/beeper/package.json.
I tried to remove “type”: “module” from /Users/myname/myproject/ghost-blog/content/themes/edition/node_modules/beeper/package.json. But It was not working.
How can I resolve this? If you know this, please let me know that. Thanks.