类星体/维特 无法解析包"fs"的条目。包中可能指定了不正确的主/模块/导出.json



当我尝试quasar dev:

时,我得到这个错误

[ERROR] [plugin vite: deep -pre-bundle]解析包"fs&quot条目失败。包可能在其包中指定了不正确的main/module/exports。解析包"fs"条目失败。package.json中可能有不正确的main/module/exports。

在网上,我发现了这个链接的解决方案:

类星体vite的解决方案是在quasar.config.js中添加这部分

extendViteConf(viteConf, { isServer, isClient }) {
// do something with viteConf... change it in-place
viteConf.resolve = {
alias: {
...viteConf.resolve.alias, // that's important we want to keep the alias set by quasar team
fs: require.resolve('rollup-plugin-node-builtins'),
child_process: require.resolve('rollup-plugin-node-builtins'),
},
};
},

为您省去数小时搜索的麻烦。

最新更新