I get so many weird errors
import $C from "js-combinatorics"
export const version = '1.5.4';
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1025:15)
at Module._compile (node:internal/modules/cjs/loader:1059:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:190:29)
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at ESMLoader.import (node:internal/modules/esm/loader:281:24)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
If I use this:
import { Combination, Permutation } from "js-combinatorics";
It gives:
import { Combination, Permutation } from "js-combinatorics";
^^^^^^^^^^^
SyntaxError: Named export 'Combination' not found. The requested module 'js-combinatorics' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
I get so many weird errors
import $C from "js-combinatorics"
If I use this:
import { Combination, Permutation } from "js-combinatorics";
It gives: