What I'm trying to do
I'm trying to use the library videojs-abloop
My nodejs version is v12.18.3
What is the problem
First I installed two libraries as asked from videojs-abloop :
npm install video.js videojs-abloop
Then ran the command
$ node --experimental-modules index.js
Error output
$ node --experimental-modules index.js
(node:31057) ExperimentalWarning: The ESM module loader is experimental.
/my_path/testimport/node_modules/videojs-abloop/videojs-abloop.js:8
export default function (window, videojs) {
^^^^^^
SyntaxError: Unexpected token 'export'
What is my project structure
I two files : index.js
and package.json
:
index.js
import videojs from 'video.js'
import abLoopPlugin from 'videojs-abloop'
abLoopPlugin(window,videojs);
package.json
{ "type": "module" }
What I have checked
I checked about the ESM imports but Node.js 12 : ESM Imports, but I think it is not related to this problem