gulp-community / gulp-favicons

gulp plugin for favicons
6 stars 3 forks source link

SyntaxError: Cannot use import statement outside a module #36

Open enspritz opened 3 months ago

enspritz commented 3 months ago

This error occurs using the example code straight off of the NPM project page with:

(node:160771) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
.../gulpfile.js:73
import favicons from 'gulp-favicons';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (node:internal/modules/cjs/loader:1427:18)
    at Module._compile (node:internal/modules/cjs/loader:1449:20)
    at Module._extensions..js (node:internal/modules/cjs/loader:1588:10)
    at Module.load (node:internal/modules/cjs/loader:1282:32)
    at Module._load (node:internal/modules/cjs/loader:1098:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16)
    at requireOrImport (.../nodejs/22.5.1/lib/node_modules/gulp/node_modules/gulp-cli/lib/shared/require-or-import.js:20:11)