Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

v2.5.0: Install reporting ERR_REQUIRE_ESM regarding del package and clean gulp script

Open mcrawshaw opened this issue 2 years ago • 6 comments

Steps

Install the [email protected] package via npm or yarn.

Actual Result

error /Users/markcrawshaw/Code/metamap/node_modules/semantic-ui: Command failed.
Exit code: 1
Command: gulp install
Arguments:
Directory: /Users/markcrawshaw/Code/metamap/node_modules/semantic-ui
Output:
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/markcrawshaw/Code/metamap/node_modules/del/index.js from /Users/markcrawshaw/Code/metamap/node_modules/semantic-ui/tasks/clean.js not supported.
Instead change the require of index.js in /Users/markcrawshaw/Code/metamap/node_modules/semantic-ui/tasks/clean.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/markcrawshaw/Code/metamap/node_modules/semantic-ui/tasks/clean.js:8:12)
    at Object.<anonymous> (/Users/markcrawshaw/Code/metamap/node_modules/semantic-ui/gulpfile.js:21:18)
    at async Promise.all (index 0) {
  code: 'ERR_REQUIRE_ESM'
}

Version

2.5.0

Recommendation

For users, you can force a resolution in your package.json to [email protected]. For maintainers, I suggest specifying 6.1 in the package.json (over *) or completing an overhaul of the gulp file to ESM (https://gulpjs.com/docs/en/getting-started/javascript-and-gulpfiles/#transpilation).

Issue is also referenced on overflow: https://stackoverflow.com/questions/74133651/semantic-ui-install-fail-npm

mcrawshaw avatar Oct 20 '22 20:10 mcrawshaw

I had the same problem, thanks @mcrawshaw.

To get past this, I did:

git clone [email protected]:Semantic-Org/Semantic-UI.git
cd Semantic-UI
npm i --save-dev [email protected]
gulp install

sepastian avatar Oct 23 '22 17:10 sepastian

I'm having the same issue. Why do we need to do a gulp install? I'm just looking for the lib here.

ninjasort avatar Nov 17 '22 14:11 ninjasort

Not sure about @sepastian setup. Generally, you are just looking to force the resolution of the del package (general steps are different for yarn vs npm - check online).

mcrawshaw avatar Nov 17 '22 21:11 mcrawshaw

Same issue here.

billchen2k avatar Nov 20 '22 14:11 billchen2k

Same issue here.

sara-amani avatar Nov 22 '22 13:11 sara-amani

I am still getting this.

courtyenn avatar Feb 19 '23 05:02 courtyenn