cpx icon indicating copy to clipboard operation
cpx copied to clipboard

cpx fails with ENOENT: no such file or directory, chmod...

Open nishant-dani opened this issue 5 years ago • 6 comments

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?

nishant-dani avatar Aug 27 '19 00:08 nishant-dani

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?

MattiasBuelens avatar Sep 19 '19 15:09 MattiasBuelens

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.

Va1tra avatar Oct 15 '19 13:10 Va1tra

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

Zryru avatar Nov 05 '19 14:11 Zryru

I'm facing a similiar issue when there is a symlink.

njzjz avatar Feb 11 '20 21:02 njzjz

Any solution on this would be nice, currently having the same issue too.

wordaddict avatar May 15 '20 16:05 wordaddict

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",

o-t-w avatar Jan 03 '21 20:01 o-t-w