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

Error on rename when 'nw install' on Windows 10 64bit #16

Open
timfish opened this issue Aug 13, 2016 · 6 comments
Open

Error on rename when 'nw install' on Windows 10 64bit #16

timfish opened this issue Aug 13, 2016 · 6 comments

Comments

@timfish
Copy link

timfish commented Aug 13, 2016


C:\Users\tim\Documents>nw install 0.16.1
Downloading 0.16.1.zip
[============================================>] 100.0% of 51.75 MB (2.01 MB/s)
shell.js: internal error
Error: EPERM: operation not permitted, rename 'C:\Users\tim\.nwjs\nwjs-v0.16.1-win-x64' -> 'C:\Users\tim\.nwjs\0.16.1'
    at Error (native)
    at Object.fs.renameSync (fs.js:809:18)
    at C:\Users\tim\AppData\Roaming\npm\node_modules\nwjs\node_modules\shelljs\src\mv.js:79:8
    at Array.forEach (native)
    at _mv (C:\Users\tim\AppData\Roaming\npm\node_modules\nwjs\node_modules\shelljs\src\mv.js:55:11)
    at C:\Users\tim\AppData\Roaming\npm\node_modules\nwjs\node_modules\shelljs\src\common.js:240:23
    at Command.<anonymous> (C:\Users\tim\AppData\Roaming\npm\node_modules\nwjs\lib\install.js:40:5)
    at next (native)
    at onFulfilled (C:\Users\tim\AppData\Roaming\npm\node_modules\nwjs\node_modules\co\index.js:65:19)

I've tried messing around deleting the directory or opening up permissions with no luck. In the end I renamed the directory myself to get it working...

@timfish
Copy link
Author

timfish commented Aug 13, 2016

For some reason nw install 0.16.1-sdk didn't have this issue...

@timfish timfish changed the title Error on rename when nw install on Windows 10 64bit Error on rename when 'nw install' on Windows 10 64bit Aug 13, 2016
@karikera
Copy link

karikera commented Dec 13, 2016

It happened to me when install 0.14.7-sdk.
I think this occur randomly..

@fritx
Copy link
Collaborator

fritx commented Dec 13, 2016

Error: EPERM: operation not permitted, rename 'C:\Users\tim\.nwjs\nwjs-v0.16.1-win-x64' -> 'C:\Users\tim\.nwjs\0.16.1'
    at Error (native)
    at Object.fs.renameSync (fs.js:809:18)
    at C:\Users\tim\AppData\Roaming\npm\node_modules\nwjs\node_modules\shelljs\src\mv.js:79:8

Seems like it's an error caused by shelljs.mv.
And I found the newer version of mv includes a try/catch on fs.renameSync:
https://github.com/shelljs/shelljs/blob/master/src/mv.js#L77-L86
Related commit: shelljs/shelljs@5d6adba

try {
  fs.renameSync(src, thisDest);
} catch (e) {
  if (e.code === 'EXDEV') { // external partition
    // if either of these fails, the appropriate error message will bubble
    // up to the top level automatically
    cp('-r', src, thisDest);
    rm('-rf', src);
  }
}

@timfish
Copy link
Author

timfish commented Dec 13, 2016

Looks like it might fix it. I still get this every time I do an install. Luckily I dont do that very often!

@ffigiel
Copy link

ffigiel commented Jan 1, 2017

I was having the same issue, here's a dirty trick to fix it (basically you manually upgrade nwjs's shelljs dependency)

$ npm install shelljs@latest
$ rm -r node_modules/nwjs/node_modules/shelljs/
$ mv node_modules/shelljs/ node_modules/nwjs/node_modules/

And then finally

$ nw install 0.19.4-sdk
Downloading 0.19.4-sdk.zip
[============================================>] 100.0% of 84.58 MB (1.26 MB/s)
√ Version 0.19.4-sdk is installed and activated

EDIT:
It still doesn't work for me

$ nw .
Cached nwjs excutable v0.19.4-sdk not found, run nw install 0.19.4-sdk first
$ nw ls
(blank line)

@Klemen1337
Copy link

  • 1 I have the same problem

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

5 participants