This dependency was not found:* fs in ./node_modules/destroy/index.js, ./node_modules/etag/index.js
This dependency was not found:* fs in ./node_modules/destroy/index.js, ./node_modules/etag/index.js报错解决办法
·
用mpvue开发小程序,页面突然报错:
This dependency was not found:* fs in ./node_modules/destroy/index.js, ./node_modules/etag/index.js
重新安装npm install --save fs 也不行,最后网上找到解决办法:
- 找到build文件下的 webpack.base.conf.js
- 在如下图位置:
上述代码:
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"
},
重启项目,就成功了!
更多推荐
已为社区贡献2条内容
所有评论(0)