Node.js and Server Side JavaScript
Running JavaScript on the server: Node.js installs, npm packages, modules, files, Express routes and the errors you meet in your first Node projects.
Threads in Node.js and Server Side JavaScript
- ✓
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...
1reply