To fix Node error: SyntaxError: Unexpected token import, we can use CommonJS modules.
For instance, we write
const calc = require("./calc");
const { add, multiply } = calc;
to call require
to include the calc.js module file.
And then we get the add
and multiply
properties from the object we set as the value of module.exports
in calc.js.