cpx
cpx copied to clipboard
cpx fails with ENOENT: no such file or directory, chmod...
Failed to copy: ENOENT: no such file or directory, chmod 'External/shared/node_modules/browser-resolve/node_modules/resolve/test/resolver/other_path/root.js'.
The file exists at source; 0 -rw-r--r-- 1 amp staff 0 Aug 26 17:12 root.js
And once the cpx fails, I check the destination the file is there too; 0 -rw-r--r-- 1 amp staff 0 Sep 7 2015 root.js
Is there a workaround for this?
We've run into this problem as well. It seems to only happen with empty files (0 bytes), but we've only seen it happen occasionally on our CI.
I suspect there's some sort of race condition going on where chmod
is called before the empty copied file is flushed to disk. But I haven't been able to reproduce this on my own machine, so I can't test this hypothesis.
@nishant-dani Do you have a way to reproduce this consistently? What machine are you using? And what are your file's properties?
I get it often when build project in a docker. The error occurs with an empty html file. The image is node:dubnium-slim
... cpx "assets/static-materials/**/*" dist && cpx "static/**/*" dist/static
.
I'm having this issue randomly too.
To recreate have a bunch of empty scss files in an assest folder and attempt to copy from assets to the resulting build /dist folder.
cpx \"project-name/src/assets/scss/**\" \"dist/project-name/assets\""
It's indeed failing only on empty files
I'm facing a similiar issue when there is a symlink.
Any solution on this would be nice, currently having the same issue too.
I am also having this issue with the following NPM script:
"build:polyfills": "cpx 'assets/polyfills/**/*.js' build/polyfills --clean -v && cpx 'node_modules/dialog-polyfill/dist/dialog-polyfill.js' build/polyfills -v",