fs包已安装,报错如下:
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff; min-height: 13.0px }
span.s1 { }
fs in ./~/[email protected]@vue-server-renderer/build.js, ./~/[email protected]@resolve/lib/sync.js and 10 others
To install it, you can run: npm install --save fs
解决方案:如果在webpack.base.conf.js没有配置node,可以试试配置一下
node: { // prevent webpack from injecting useless setImmediate polyfill because Vue // source contains it (although only uses it if it‘s native). setImmediate: false, // prevent webpack from injecting mocks to Node native modules // that does not make sense for the client dgram: ‘empty‘, fs: ‘empty‘, net: ‘empty‘, tls: ‘empty‘, child_process: ‘empty‘ }
原文地址:https://www.cnblogs.com/lixuemin/p/9070946.html
时间: 2024-11-01 15:20:44