Semantic-Org / Semantic-UI

Semantic is a UI component framework based around useful principles from natural language.
http://www.semantic-ui.com
MIT License
51.12k stars 4.94k forks source link

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

Open mcrawshaw opened 2 years ago

mcrawshaw commented 2 years ago

Steps

Install the semantic-ui@2.5.0 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 del@6.1. 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

sepastian commented 2 years ago

I had the same problem, thanks @mcrawshaw.

To get past this, I did:

git clone git@github.com:Semantic-Org/Semantic-UI.git
cd Semantic-UI
npm i --save-dev del@6.1
gulp install
ninjasort commented 1 year ago

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

mcrawshaw commented 1 year ago

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).

billchen2k commented 1 year ago

Same issue here.

sara-amani commented 1 year ago

Same issue here.

courtyenn commented 1 year ago

I am still getting this.