Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Cannot use import statement outside a module #36

Open
enspritz opened this issue Aug 3, 2024 · 0 comments
Open

SyntaxError: Cannot use import statement outside a module #36

enspritz opened this issue Aug 3, 2024 · 0 comments

Comments

@enspritz
Copy link

enspritz commented Aug 3, 2024

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

  • The supplied RunKit link on the NPM project page, and
  • When trying in a fresh, up-to-date install of gulp.
(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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant