zowe / zowe-cli-scs-plugin

The secure credential store plugin for Zowe CLI, leveraging keytar and the OS keychain to securely access and store sensitive user credentials normally stored in CLI profiles.
Eclipse Public License 2.0
8 stars 3 forks source link

Uninstall of plugin fails with EPERM on Windows #20

Open ghost opened 4 years ago

ghost commented 4 years ago

On Windows I get the following error when uninstalling the plugin:

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\xxx\.zowe\plugins\installed\node_modules\@zowe\secure-credential-store-for-zowe-cli\node_modules\keytar\build\Release\keytar.node
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\xxx\.zowe\plugins\installed\node_modules\@zowe\secure-credential-store-for-zowe-cli\node_modules\keytar\build\Release\keytar.node'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\xxx\.zowe\plugins\installed\node_modules\@zowe\secure-credential-store-for-zowe-cli\node_modules\keytar\build\Release\keytar.node'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\xxx\.zowe\plugins\installed\node_modules\@zowe\secure-credential-store-for-zowe-cli\node_modules\keytar\build\Release\keytar.node'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'C:\\Users\\xxx\\.zowe\\plugins\\installed\\node_modules\\@zowe\\secure-credential-store-for-zowe-cli\\node_modules\\keytar\\build\\Release\\keytar.node'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, unlink 'C:\\Users\\xxx\\.zowe\\plugins\\installed\\node_modules\\@zowe\\secure-credential-store-for-zowe-cli\\node_modules\\keytar\\build\\Release\\keytar.node'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\xxx\\.zowe\\plugins\\installed\\node_modules\\@zowe\\secure-credential-store-for-zowe-cli\\node_modules\\keytar\\build\\Release\\keytar.node',
npm ERR!   parent: '@zowe/secure-credential-store-for-zowe-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2020-05-04T15_58_43_528Z-debug.log
Command Error:
Uninstall Failed
Error Details:
Command failed: "C:\Program Files\nodejs\node.exe" "C:\Users\xxx\AppData\Roaming\npm\node_modules\npm" uninstall "@zowe/secure-credential-store-for-zowe-cli" --prefix C:\Users\xxx\.zowe\plugins\installed -g

If I navigate to the keytar.node file in File Explorer, I am able to delete it without being prompted for admin access. After doing that, I am able to run the uninstall command successfully.

mheuzey commented 3 years ago

I got this same error, but I simply reissued the uninstall command and it worked the second time. The problem could be intermittent.