我从node src/index.js
开始代码(从--experimental-modules
标志开始给出同样的错误)。
在package.json type: "module"
我的代码:index.js
import Client from './structures/CalidiumClient';
import moment from 'moment';
const bot = new Client();
moment.locale('ru');
bot.start();
错误:
(node:8560) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/esm/resolve.js:61
let url = moduleWrapResolve(specifier, parentURL);
^
Error: Cannot find module D:\ÐоÑкÑÑ\Calidium\src\structures\CalidiumClient imported from D:\ÐоÑкÑÑ\Calidium\src\index.js
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:61:13)
at Loader.resolve (internal/modules/esm/loader.js:85:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:191:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:42:40)
at link (internal/modules/esm/module_job.js:41:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
UPD :我正在使用node.js v13.11.0