stencil
stencil copied to clipboard
WINDOWS Build Error EPERM: operation not permitted, copyfile
Stencil version:
@stencil/[email protected]
I'm submitting a:
[X] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior: stencil doesn't remove old read-only files that it copied to the www folder before it tries to copy them again on a subsequent run, thus an EPERM error happens on Windows.
Expected behavior: Read only files should be handled correctly by the build system.
Steps to reproduce: Copy the project found in: https://github.com/mmakrzem/stencilCopyBug
mark the file found in src/assets/images/readOnlyImage.jpg as being read-only
npm i
npm run start
stop the running session
npm run start
On the 2nd run, you will see the build error:
Build Error EPERM: operation not permitted, copyfile 'C:\st-1-17-2-copyBug\src\assets\images\readOnlyImage.jpg' -> 'C:\st-1-17-2-copyBug\www\assets\images\readOnlyImage.jpg'
I filed this bug a while ago here: https://github.com/ionic-team/stencil/issues/2235 It was claimed to be fixed, but the problem is still occurring and isn't fixed
hey, i was having this issue, when using vue.js, everytime i runned 'npm run dev' or 'npm run watch' this error appears, im using docker server, stopping it before run 'npm run dev' worked for me
hope you understood what i said
Getting same issue Code:
const fs = require('fs');
fs.copyFile('./dist/frontend.controls.0.0.1.umd.min.js', './../../dist/content/lib/asi/js/', (err) => {
if (err) throw err;
console.log('frontend.controls.0.0.1.umd.min.js was copied to destination.txt');
});
Error:
[Error: EPERM: operation not permitted, copyfile 'D:\Foundation.Web\src\frontend-control-library\dist\frontend.controls.0.0.1.umd.min.js' -> 'D:\Foundation.Web\dist\content\lib\asi\js'] {
errno: -4048,
code: 'EPERM',
syscall: 'copyfile',
path: 'D:\\Foundation.Web\\src\\frontend-control-library\\dist\\frontend.controls.0.0.1.umd.min.js',
dest: 'D:\\Foundation.Web\\dist\\content\\lib\\asi\\js'
}
It may be that the file is being used
It seems that when copying an asset, Stencil doesn't remove the 'readonly' flag on the file. This results in a failure (I believe) due to trying to overwrite a readonly file (that was placed in www/assets/images/
) on the first build