nodists / nodist

Natural node.js and npm version manager for windows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot uninstall latest node. EPERM error.

mrchief opened this issue · comments

C:\WINDOWS\system32>nodist - 8.x
EPERM: operation not permitted, unlink 'C:\Program Files (x86)\Nodist\v-x64\8.1.
3\node.exe'.
Sorry.
C:\WINDOWS\system32>nodist ls
  (x64)
  4.4.4
  6.11.0
  7.2.1
> 8.1.3  (global: 8.x)

image

Seems like anything marked globally creates a symlink and then that causes the unlink error.

λ nodist + 8.x
 8.4.0 [===============] 22392/22392 KiB 100% 0.0s
8.4.0

λ nodist global 8.x
8.x
Default global pacakge update dsuccessful.

λ nodist ls
  (x64)
  4.4.4
  6.11.0
  7.2.1
  8.1.3
> 8.4.0  (F:\git\apps\test\.node-version: 8.x) (global: 8.x)

λ nodist - 8.1.3
EPERM: operation not permitted, unlink 'C:\Program Files (x86)\Nodist\v-x64\8.1.3\node.exe'.
Sorry.

I notice that you installed a different version than the one you removed, so it could be that for some reason somewhere node 8.1.3 is still running?

Well no. The first screenshot is when I only had node 8.1.3. No other global node installs. (first screenshot)

Since the uninstall failed, I thought of installing another version and trying again. That also failed. (2nd screenshot).

tl;dr - the file was in use in some rogue/window app. Killing it through process explorer solved the issue.

Longer version:
I scanned for symlinks using Junction Link Magic and found no links to/from 'C:\Program Files (x86)\Nodist\v-x64\8.1.3\node.exe'. Windows Explorer also confirms the same.

image

But I did try removing node 8.4.0 and that worked without issues. I then thought of deleting the 8.1.3 file directly and Windows gave a file in use error. So searched and killed all nodejs processes and then nodist - 8.1.3 went through fine.