?報錯詳情:
報錯原因:手欠把body-parser安到前端了
解決方法:把body-parser刪了就行了
另外進行了以下錯誤嘗試:
找資料發(fā)現vue2出現這種情況,需要得webpack.config.js里新增
node: {
fs: 'empty'
},
在vue3中,沒有webpack.config.js,就在vue.config.js里加 resolve: { fallback: { fs: false } },配置后終端也是不報錯了。
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
resolve: { fallback: { fs: false } }
},
devServer: {...}
但是我這樣配置后瀏覽器報錯Cannot read property 'transfer-encoding ' of undefined,所以還是不能false fs,最后還是刪node_modules,packjson刪掉bodyparser,重新npm install的。文章來源:http://www.zghlxwxcb.cn/news/detail-548542.html
如果還是不行,就按照報錯目錄,一條條手動刪bodyparser相關文章來源地址http://www.zghlxwxcb.cn/news/detail-548542.html
到了這里,關于報錯記錄:can‘t resolve ‘fs‘ in node_modules,Vue3的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!