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

Cannot move folder and its content (error -4058) #1

Closed
gigouni opened this issue Sep 25, 2018 · 3 comments
Closed

Cannot move folder and its content (error -4058) #1

gigouni opened this issue Sep 25, 2018 · 3 comments

Comments

@gigouni
Copy link

gigouni commented Sep 25, 2018

Hi,

What's happening

I would like to move a folder and its content to the parent folder through the CLI

move-cli ./dist/transpiled ./dist

but it returns an error

{ Error: EPERM: operation not permitted, rename 'my\project\dist\transpiled' -> 'my\project\dist'
  errno: -4048,
  code: 'EPERM',
  syscall: 'rename',
  path: 'my\project\\dist\\transpiled',
  dest: 'C:\\Users\\ngigou\\dev\\apps\\output-labels-backend\\dist' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! output-labels@1.0.0 obfuscate: `javascript-obfuscator ./transpiled --output dist && move-cli ./dist/transpiled ./dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the output-labels@1.0.0 obfuscate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ngigou\AppData\Roaming\npm-cache\_logs\2018-09-25T07_39_36_012Z-debug.log

The context

I'm transpiling source code to a "transpiled" folder. Then, I obfuscate the transpiled code within a "dist" folder (with javascript-obfuscator). The problem is that the obfuscated code goes to a sub-folder of "dist" instead of directly in "dist". I'm trying to move the content to earn one folder level.

From

|
| dist
| | transpiled
| | | my transpiled and obfuscated code
| transpiled
| src

To

|
| dist
| | my transpiled and obfuscated code
| transpiled
| src

The complete npm script

"obfuscate": "javascript-obfuscator ./transpiled --output dist && move-cli ./dist/transpiled ./dist",

Information

> node -v && npm -v
v8.10.0
5.6.0
  • Nom du système d’exploitation : Microsoft Windows 10 Professionnel
  • Version: 10.0.16299 Numéro 16299

Thanks

@koenig-dominik
Copy link
Owner

koenig-dominik commented Sep 25, 2018

This project just uses mv under the hood. This is only the cli layer to use it in npm scripts and stuff.
I found basically the same issue over there: Issue 21

But this repo wasn't updated for 3 years now, so I guess they won't fix that issue

@gigouni
Copy link
Author

gigouni commented Sep 26, 2018

Thanks @koenig-dominik for your help. I'll try something else.

@gigouni gigouni closed this as completed Sep 26, 2018
@gigouni
Copy link
Author

gigouni commented Sep 26, 2018

FYI,

Solved it using another npm module, copy-dir-cli. Simple but works great!

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

2 participants