I'm attempting to use webpack for the first time and I'm getting this error,
Error: EACCES: permission denied, mkdir '/dist'
at Error (native)
when trying to run my production script.
A sudo chown -R 'whoami' /dist
came back with chown: /dist: No such file or directory
.
How can I go about resolving this?
As Camp bell mentioned you need to remove forward slash before dist folder in the output path section.
In my case I had to remove forward slash before build. Check my example below
Wrong one:
output: {
path: path.resolve(__dirname, "/build/"), //remove forward slash here
publicPath: "/",
filename: "bundle.js"
}
Correct one:
output: {
path: path.resolve(__dirname, "build/"),
publicPath: "/",
filename: "bundle.js"
}
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With