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

Need to manually remove folder on nvm uninstall #252

Closed
jeffrson opened this issue Mar 11, 2017 · 13 comments
Closed

Need to manually remove folder on nvm uninstall #252

jeffrson opened this issue Mar 11, 2017 · 13 comments
Labels

Comments

@jeffrson
Copy link
Contributor

Hi,
here are the steps to reproduce (including error description). This happens on x64 system,

nvm install x.y.z (6.10.0 or alike, but version doesn't matter)
nvm uninstall x.y.z
=> uninstallation successful, no leftover

nvm install x.y.z
nvm use x.y.z
nvm use u.v.w (another version - just to be sure x.y.z is not used - this step is probably not necessary)
nvm uninstall x.y.z
=> need to remove folder x.y.z manually from nvm path, which always contains node.exe alone

IMO, this happens because before the "use" there is a node64.exe, which is renamed on "use" into node.exe. This node.exe remains from this point on and obviously blocks removal of folder.

I hope the description is clear enough.
Thanks

@coreybutler
Copy link
Owner

If you run nvm ls after this, does it show the uninstalled version?

@jeffrson
Copy link
Contributor Author

jeffrson commented Mar 12, 2017 via email

@coreybutler
Copy link
Owner

OK, I've marked this as a bug. Which version of Windows are you running?

@jeffrson
Copy link
Contributor Author

jeffrson commented Mar 12, 2017 via email

@jeffrson
Copy link
Contributor Author

jeffrson commented Mar 13, 2017 via email

@coreybutler
Copy link
Owner

Once the executable completes an operation, it is no longer associated to any files. In other words, the executable runs one operation, then closes all file connections by exiting. However; I have not had a chance to personally test this on the latest Windows build. If Windows is now using a file lock for this operation, then you may be right... that could be lingering.

I'll try to debug this as soon as I can, but I'm on a contract job this week and have SXSWi obligations. So, it may be awhile before I can actually sit down with this.

@jeffrson
Copy link
Contributor Author

jeffrson commented Mar 13, 2017 via email

@shaneknysh
Copy link

shaneknysh commented Mar 30, 2017

I did a little testing and this only occurs if you nvm use x.x.x the version to be removed AND you are using arch 64. As has been mentioned the node64.exe is renamed to node.exe and not removed. However, if you use another version and manually rename node.exe to node64.exe (as ujaroe mentions) then the uninstall is completed successfully.

This means there is a couple of ways to correct the problem. I would recommend 'nvm use' restoring the version folder the use command is moving FROM back to the original state. The other is having uninstall check arch and make sure the node executable matches the arch of the version. There are a couple other things that could be done with symlinks but I think these are the best two options. My Go skill is pretty low but I will attempt to build one or both of these soon.

edit: spelling

@darsain
Copy link

darsain commented Aug 22, 2017

Same issue here. CLI output:

❯ nvm list

  * 8.4.0 (Currently using 64-bit executable)
    6.11.2
    6.10.0

❯ nvm uninstall 6.10.0
Uninstalling node v6.10.0...Error removing node v6.10.0
Manually remove C:\Users\darsain\AppData\Roaming\nvm\v6.10.0.

❯ nvm list

  * 8.4.0 (Currently using 64-bit executable)
    6.11.2
    6.10.0

After running the uninstall command, the v6.10.0 folder had only node.exe file in it. I'm 99% sure nothing was using it. Deleting manually worked fine.

But, the v6.10.0 version was installed a while ago on nvm 1.1.1 I think. Today I upgraded to 1.1.6. Installing and removing node 6.11.2 which I did today after the upgrade worked fine though.

@fabiannagel
Copy link

I can confirm this one. Also happened to me on Win10 x64 using node v6.9.1 and nvm 1.1.3

@cardin
Copy link

cardin commented May 16, 2018

Also happened on Win10 x64 (version 1709) using node v8.11.1 and nvm 1.1.6

@lq92
Copy link

lq92 commented Jun 20, 2018

Hi, @coreybutler,the bug also happened on Windows10 x64, and if i use nvm use x.y.z command to switch the version of nodejs, the x.y.z will not be uninstalled, while the a.b.c's version if i could not use nvm use command, it can be uninstalled

@b-dur b-dur closed this as completed in 50cef2e Jul 10, 2018
b-dur pushed a commit that referenced this issue Jul 10, 2018
Fixes #252 - Need to manually remove folder on nvm uninstall
@vincent-cm
Copy link

need to reopen due to same issue on macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants