gulp-image
gulp-image copied to clipboard
Don't work - Error [ERR_REQUIRE_ESM]: Must use import to load ES Module
$ gulp Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: ...\06_test_Gulp\node_modules\gulp-image\index.js require() of ES modules is not supported. require() of ...\06_test_Gulp\node_modules\gulp-image\index.js from ...\06_test_Gulp\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 ...\06_test_Gulp\node_modules\gulp-image\package.json.
at new NodeError (node:internal/errors:363:5)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1126:13)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (...\06_test_Gulp\gulpfile.js:7:15)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32) {
code: 'ERR_REQUIRE_ESM' }
Same here. I was able to downgrade to 6.2.1 and get it running.
Thank you very much! Downgraded the version now the error does not appear, I check whether the plugin works
Duplicate of #139
@elcaptain I believe it should be npm install [email protected]
.
@jbsmith731 yes, thanks. I noticed it myself shortly after so i deleted my original post, sorry ^^" I can report that downgrading solved my error too.