Addenda: The .mjs extension
无法使用 require()
扩展名为 .mjs
的文件。
尝试这样做会抛出错误。
.mjs
扩展名是为无法通过 require()
加载的 ECMAScript 模块保留的。
有关更多详细信息,请参阅 ECMAScript 模块。
It is not possible to require()
files that have the .mjs
extension.
Attempting to do so will throw an error. The .mjs
extension is
reserved for ECMAScript Modules which cannot be loaded via require()
.
See ECMAScript Modules for more details.