Skip to content
CoursesWeb Forum
Sections

import

1 thread tagged with this topic

Threads tagged import

  1. ✓

    How do I fix Cannot use import statement outside a module in Node.js?

    Node.js is treating your file as CommonJS, where import is not allowed. Tell Node the file is an ES module: add "type": "module" to the nearest package.json...

    Node.js and Server Side JavaScriptCallum IwuStaff answer
    0replies
CoursesWeb Forum. Questions and answers on learning web development: HTML, CSS, JavaScript, PHP, MySQL, Node.js and AI coding help.