question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

file already exists

See original GitHub issue

We have .env and .env.development files in the C:\projects\xxx\. Running cpy gives:

$ npx cpy './.env.development' './.env'
Cannot copy from `C:\projects\xxx\.env.development` to `C:\projects\xxx\.env\.env.development`: Cannot create directory `C:\projects\xxx\.env`: EEXIST: file already exists, mkdir 'C:\projects\xxx\.env'

Is that the expected result? Is there a workaround? @sindresorhus

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
reveltcommented, Feb 7, 2019

I see… Do you think we can solve this or are you happy with shx? I’m a user of this cli myself and one-to-one file copying works fine. But API can always be improved, it’s just we have to draw up a persuasive case first. What do you think @dy ?

0reactions
sindresorhuscommented, Jun 11, 2019

Yeah, that’s a bug in cpy. It should allow the the destination to be a file if the source is just one file and the destination doesn’t already exist as a directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Message - The file already exists. Do you want to overwrite it?
Press Yes to overwrite the existing file with a new one. Press Cancel to abort the operation. See Also. Exporting Test Results.
Read more >
Fix File Already Exists
The error message "File Already Exists" or "File Already in Use" indicates that a file CTI Navigator Desktop is attempting to use is...
Read more >
The file <filename> already exists. Do you want to replace it?
If you click Cancel, you can change the name of the file that's already in your destination directory so you don't overwrite it,...
Read more >
Cannot Create a File When That File Already Exists ... - YouTube
Cannot Create a File When That File Already Exists In Windows 10/8/7 FIX [Tutorial].Several users are reportedly getting the “Cannot create ...
Read more >
[FIXED] Cannot Create a File When That File Already Exists
If you want to Get Rid of Cannot Create a File When That File Already Exists Error Issue then just Check this cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found