I run npm run watch on WSL2 (Ubuntu 20.04.1 LTS). But get the following error.
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/DumpStack.log.tmp'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/hiberfil.sys'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/pagefile.sys'
Watchpack Error (initial scan): Error: EACCES: permission denied, lstat '/mnt/c/swapfile.sys'
This is my webpack config
const path = require('path');
const devMode = process.env.NODE_ENV !== 'production';
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
"main": './views/js/main.js'
},
mode: 'development',
output: {
filename: 'js/[name].js',
chunkFilename: 'js/[id].[chunkhash].js',
path: path.resolve(__dirname, 'public')
},
module: {
rules: [
{
test: /\.js$/,
enforce: "pre",
use: ["source-map-loader"],
},
{
test: /\.css$/,
exclude: /node_modules/,
use: [
{ loader: MiniCssExtractPlugin.loader },
{
loader: 'css-loader',
options: {
importLoaders: 1,
}
},
{ loader: 'postcss-loader' }
]
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: devMode ? 'css/[name].css' : 'css/[name].[hash].css'
})
],
devtool: 'cheap-module-source-map'
}
Is there anyone with the same problem? How did you fix it?