--experimental-modules
フラグ付きの Node.js v8.7.0 で次の構文を使用して ESM モジュールにインポートしようとしました。
import { check, validationResult } from 'express-validator/check';
import { matchedData, sanitize } from 'express-validator/filter';
ただし、次のエラーが発生します。
(node:29028) ExperimentalWarning: The ESM module loader is experimental.
SyntaxError: The requested module does not provide an export named 'check'
at checkComplete (internal/loader/ModuleJob.js:86:27)
at moduleJob.linked.then (internal/loader/ModuleJob.js:69:11)
at <anonymous>
--experimental-modules
フラグ付きでオンになっている ESM モジュールの正しい使用法は何ですか?
@std/esm
パッケージでもテストしました。Iターンのみ動作しますcjs: true
。