sicksync icon indicating copy to clipboard operation
sicksync copied to clipboard

update command failed on EPERM

Open amiram opened this issue 8 years ago • 5 comments

I'm using sicksync on windows with mingw. I installed sicksync globally using node 6.9.5 installed with nvm-windows. When I run the update command I see a successful update of the remote machine but then I get an error about my local machine. After that, sicksync is not installed anymore. Error is:

[Function: getHostname] '\u001b[31mUpdate failed! Please run manually\u001b[39m' { Error: Command failed: npm i -g sicksync npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\sicksync\node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "i" "-g" "sicksync" npm ERR! node v6.9.4 npm ERR! npm v3.10.10 npm ERR! path C:\Program Files\nodejs\sicksync npm ERR! code EPERM npm ERR! errno -4048 npm ERR! syscall open

npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\sicksync' npm ERR! at Error (native) npm ERR! { Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\sicksync' npm ERR! at Error (native) npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'open', npm ERR! path: 'C:\Program Files\nodejs\sicksync' } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! xxx\npm-debug.log

at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

killed: false, code: 4294963248, signal: null, cmd: 'npm i -g sicksync' }

amiram avatar Feb 15 '17 08:02 amiram

That's very interesting, thanks for the issue. EPERM has to do with file-permissions issues, so it's likely the update command isn't doing something right.

I'm not terribly familiar with running node packages on windows. Could you elaborate on how you originally installed? The commands you ran and such. I'm guess that the update command isn't executing the same steps that windows and nvm-windows likely requires. Just my suspicion.

joelgriffith avatar Feb 15 '17 16:02 joelgriffith

In windows you can install node in two ways. First is just download the installer from nodejs website. This installs node in C:\Program Files\nodejs. Second way, which is the way I use, is using nvm-windows. This is installing node in %userprofile%\AppData\Roaming\nvm\vx.x.x which create a vx.x.x folder for each version. C:\Program Files\nodejs is a symlink to the current version you set in nvm-windows. Except from that, all npm commands are the same. BTW, do you know from the above whick command failed? Also, why is it trying to install sicksync? I already did that.

amiram avatar Feb 15 '17 18:02 amiram

sicksync update is just a small helper utility for updating itself, which I'll admit is strange. The nice thing about this command, as opposed to manually updating, is that it will also update sicksync on your remote machines as well. Otherwise, you'd have to manually ssh into each machine and update manually, which was a bit time consuming.

I wonder if the doctor command would find anything... could you try running sicksync doctor and see what that says?

joelgriffith avatar Feb 21 '17 16:02 joelgriffith

This is what I get for doctor:

  • Checking if config is present... Found the sicksync config file!

  • Checking config file... sicksync's config has all the right properties and looks good!

  • Checking projects in config file... src has all the right properties and looks good!

  • Checking host for each project events.js:160 throw er; // Unhandled 'error' event ^

Error: spawn ssh ENOENT at exports._errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:359:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

amiram avatar Feb 22 '17 08:02 amiram

The above is probably because I used cmd.exe. If I use mingw64 I get this although I can do ssh without a problem:

$ sicksync doctor

  • Checking if config is present... Found the sicksync config file!

  • Checking config file... sicksync's config has all the right properties and looks good!

  • Checking projects in config file... src has all the right properties and looks good!

  • Checking host for each project Successfully connected to x.x.x.x with user xxx!

  • Checking sicksync on hosts for each project Timed out waiting to connect to x.x.x.x with user xxx Check to make sure your machine is reachable by by sshing: [email protected] (node:11656) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): false

amiram avatar Feb 22 '17 08:02 amiram