Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old dependency on del causes errors on Windows #202

Open
manfred-brands opened this issue Jul 19, 2021 · 0 comments
Open

Old dependency on del causes errors on Windows #202

manfred-brands opened this issue Jul 19, 2021 · 0 comments

Comments

@manfred-brands
Copy link

Issue description or question

You depend on del version 4.1.1, in the mean time there is del version 6.0.0
The old version has some issues deleting directories.

When I manually update yarn.lock to pretend clean-webpack-plugin depends on del version 6.0.0, the webpack serve command runs successfully.

webpack serve output:

```bash
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:3001/
<i> [webpack-dev-server] On Your Network (IPv4): http://10.1.1.64:3001/
<i> [webpack-dev-server] Content not from webpack is served from 'C:\Development\Fugro\fugro.utilization.service.aws\spa\lib' directory
<i> [webpack-dev-middleware] wait until bundle finished: /
<e> [webpack-dev-middleware] Error: ENOTEMPTY: directory not empty, rmdir 'C:\Development\Fugro\fugro.utilization.service.aws\spa\lib\assets'
<e>     at Object.rmdirSync (fs.js:890:10)
<e>     at rmkidsSync (C:\Development\Fugro\fugro.utilization.service.aws\node_modules\del\node_modules\rimraf\rimraf.js:364:25)
<e>     at rmdirSync (C:\Development\Fugro\fugro.utilization.service.aws\node_modules\del\node_modules\rimraf\rimraf.js:342:7)
<e>     at Function.rimrafSync [as sync] (C:\Development\Fugro\fugro.utilization.service.aws\node_modules\del\node_modules\rimraf\rimraf.js:312:9)
<e>     at C:\Development\Fugro\fugro.utilization.service.aws\node_modules\del\index.js:65:11
<e>     at Array.map (<anonymous>)
<e>     at module.exports.sync (C:\Development\Fugro\fugro.utilization.service.aws\node_modules\del\index.js:57:40)
<e>     at CleanWebpackPlugin.removeFiles (C:\Development\Fugro\fugro.utilization.service.aws\node_modules\clean-webpack-plugin\dist\clean-webpack-plugin.js:179:37)
<e>     at CleanWebpackPlugin.handleInitial (C:\Development\Fugro\fugro.utilization.service.aws\node_modules\clean-webpack-plugin\dist\clean-webpack-plugin.js:119:10)
<e>     at C:\Development\Fugro\fugro.utilization.service.aws\node_modules\clean-webpack-plugin\dist\clean-webpack-plugin.js:84:14 {
<e>   errno: -4051,
<e>   syscall: 'rmdir',
<e>   code: 'ENOTEMPTY',
<e>   path: 'C:\\Development\\Fugro\\fugro.utilization.service.aws\\spa\\lib\\assets'
<e> }

Webpack Config

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
var webpack = require('webpack');

module.exports = {
  //  mode: 'none',
    entry: {
        app: path.join(__dirname, 'src', 'index.tsx')
    },
    target: 'web',
    resolve: {
        extensions: ['.ts', '.tsx', '.js']
    },
    devServer: {
        static: [
            {
                directory: path.resolve(__dirname, 'lib'),
                watch: true
            }
        ],
        compress: true,
        port: 3001,
        open: true
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                use: 'ts-loader',
                exclude: '/node_modules/'
            },
            {
                test: /\.css$/i,
                use: ['style-loader', 'css-loader'],
            },
            {
                test: /\.(png|jpe?g|gif)$/i,
                use: [
                    {
                        loader: 'file-loader'
                    },
                ],
            },
        ],
    },
    output: {
        filename: '[name].[contenthash].js',
        path: path.resolve(__dirname, 'lib'),
        clean: true
    },
    plugins: [
        new CleanWebpackPlugin(),
        new HtmlWebpackPlugin({
            template: path.join(__dirname, 'src', 'index.html')
        }),
        new webpack.ProvidePlugin({
            process: 'process/browser',
        }),
    ]
}

Environment

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 17.57 GB / 31.77 GB
  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant