【发布时间】:2021-05-03 16:46:40
【问题描述】:
当我在我的项目中尝试构建时,我得到了这个:
[!] Error: Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)
node_modules/bson/ext/win32/x64/bson.node (1:2)
然后显示了很多看起来像 Windows 可执行文件的垃圾,我无法执行,因为我在 Linux 上。问题是我修改了包以便不包含该文件,MongoDb 中包含的 BSON 包也是如此。
编辑这两个包会导致:
[!] Error: Could not resolve '../build/Release/bson' from ../build/Release/bson?commonjs-external
Error: Could not resolve '../build/Release/bson' from ../build/Release/bson?commonjs-external
at error (/home/sergio/Documentos/PageHistory/node_modules/rollup/dist/shared/rollup.js:5305:30)
at ModuleLoader.handleResolveId (/home/sergio/Documentos/PageHistory/node_modules/rollup/dist/shared/rollup.js:18531:24)
at /home/sergio/Documentos/PageHistory/node_modules/rollup/dist/shared/rollup.js:18487:22
at async Promise.all (index 0)
at ModuleLoader.fetchStaticDependencies (/home/sergio/Documentos/PageHistory/node_modules/rollup/dist/shared/rollup.js:18485:34)
at async Promise.all (index 0)
at ModuleLoader.fetchModule (/home/sergio/Documentos/PageHistory/node_modules/rollup/dist/shared/rollup.js:18461:9)
at async Promise.all (index 1)
at ModuleLoader.fetchStaticDependencies (/home/sergio/Documentos/PageHistory/node_modules/rollup/dist/shared/rollup.js:18485:34)
at async Promise.all (index 0)
有什么想法吗?
【问题讨论】:
-
首先,提取minimal reproducible example 并将其包含在您的问题中。另外,请阅读您应用的标签的所有描述,至少有一个是错误的。