gpt4 book ai didi

laravel - 找不到模块 : Error: Can't resolve 'fs'

转载 作者:行者123 更新时间:2023-12-04 16:35:15 25 4
gpt4 key购买 nike

我从事 Laravel 5.3 项目。我在运行时遇到错误 gulp CMD 中的命令。

enter image description here

谁能说我怎样才能得到更少的错误结果?

gulpfile.js

var elixir = require('laravel-elixir');

require('laravel-elixir-vue');

elixir(function(mix) {
mix.sass('app.scss');
});


elixir(function(mix) {
mix.webpack('app.js');
});


elixir(function(mix) {
mix.version(['css/app.css', 'js/app.js']);
});

包.json
{
"private": true,
"scripts": {
"prod": "gulp --production",
"dev": "gulp watch"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-loader": "^6.2.7",
"babel-plugin-add-module-exports": "^0.2.1",
"bootstrap": "^4.0.0-alpha.3",
"bootstrap-sass": "^3.3.7",
"buble": "^0.14.2",
"gulp": "^3.9.1",
"jquery": "^3.1.0",
"laravel-elixir": "^6.0.0-9",
"laravel-elixir-browserify-official": "^0.1.3",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-vue-2": "^0.2.0",
"laravel-elixir-webpack-official": "^1.0.2",
"lodash": "^4.14.0",
"vue": "^1.0.26",
"vue-resource": "^0.9.3"
},
"dependencies": {
"admin-lte": "^2.3.7",
"node-sass": "^3.13.0"
}
}

最佳答案

如果您使用 Laravel 5.5 或更高版本,只需添加:

mix.webpackConfig({ node: { fs: 'empty' }})

给您的 webpack.mix.js文件。

关于laravel - 找不到模块 : Error: Can't resolve 'fs' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40950176/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com