#TIL | Execute ES6 module with node.js
When executing a script designed as an ES6 module (f.e. node my-module.js
), it will fail with the error Cannot use import statement outside a module
.
Add "type": "module"
to package.json and it will work.
You can interact with this note (applause, criticism, whatever) by mention it in one of your posts, which will be shown here as a Webmention.
Webmentions
No Webmentions yet...