Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nishant-dani opened this issue Aug 27, 2019 · 6 comments
Open

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

nishant-dani opened this issue Aug 27, 2019 · 6 comments

Comments

@nishant-dani
Copy link

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?

@MattiasBuelens
Copy link

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?

@Va1tra
Copy link

Va1tra commented Oct 15, 2019

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.

@Zryru
Copy link

Zryru commented Nov 5, 2019

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

@njzjz
Copy link

njzjz commented Feb 11, 2020

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

@wordaddict
Copy link

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

@o-t-w
Copy link

o-t-w commented Jan 3, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants