Closed incompletude closed 6 years ago
Neither sound like something write-file-webpack-plugin
would have an effect on.
Whats the path that EACCESS
is complaining about?
Hi here, @gajus I have the same issue using the plugin. Here is the error message: Error: EACCES: permission denied, mkdir '/img'
. Hope that helps!
@gajus It was some weird interaction with clean-webpack-plugin: ^0.1.19
. I think it is fixed for now.
But I have this issue without using the clean-webpack-plugin
plugin :/
But I have this issue without using the clean-webpack-plugin plugin :/
I suggest trying to inspect the issue yourself.
It is very unlikely that it is originating from write-file-webpack-plugin
. Even if the error points to write-file-webpack-plugin
, it is likely some misconfiguration/ version incompatibility.
Looking at the error:
Error: EACCES: permission denied, mkdir '/img'
You are attempting to write something to /img
directory, which you shouldn't have permission to write to unless you are root. Therefore the script is right to fail.
The question is why you are getting this error only with write-file-webpack-plugin
(I am assuming you've tested without the plugin to ensure that the plugin is the culprit).
I never had this issue before. Now I am trying to write the build files when I use webpack-dev-server
and it throws this issue (I just added this plugin). I will try to figure out in my code as soon as I have time.
It seems to be related to https://github.com/webpack-contrib/copy-webpack-plugin/issues/41
It seems to be related to webpack-contrib/copy-webpack-plugin#41
I confirm, this was due to a webpack loader using an outputPath
beginning by /
, we have to remove it (in my case it was file-loader
with /img/
and now it works when I use img/
).
I suppose, since write-file-webpack-plugin
uses these paths to write files, this is why I got the error from this plugin. Maybe @gajus, it could be great to add some documentation about this case?
Thanks for your help 👍
Maybe @gajus, it could be great to add some documentation about this case?
Good idea. PR would be welcome.
I'm not sure how to properly name this. I have been trying to use write file webpack plugin but I'm facing two problems on a macOS High Sierra and webpack-dev-server v3.1.4.
First, when using
npm start
(mapped towebpack-dev-server --mode development --open
), adding the write plugin opens the Safari browser instead of the default browser.Second, the plugin requires me to run
sudo npm start
, or it will throw an EACCESS error. This is not required by the standalone webpack.