When I check my node version after using nvm, I get this error.
winpty: error: cannot start '"C:/Program Files/nodejs/node.exe" -v': %1 is not a valid Win32 application. (error 0xc1)
However, the nvm commands work
Assuming you ran nvm use x.x.x
, you shouldn't have any issues displaying the current version. This looks like a potential shell issue (winpty). Are you running a special shell or is it just the stock terminal/powershell?
I use PowerShell and CMD and the issue was the same
I have 8.11.1 and 11.5.0 and both versions give the same error, after nvm use x.x.x
+1
Did you have a prior version of Node installed before installing NVM4W?
I was having 11.5.0
I had this error and I solved it by uninstalling all Node versions and reinstalling them. I had one v9, two v10, and two v11 versions and the latest (v11.6.0) wasn't working after installing it.
Edit: This was the error I received, but I got the same error as above when using PowerShell: zsh: exec format error: node
.
Per the README (see https://github.com/coreybutler/nvm-windows#installation--upgrades), any original version of Node needs to be uninstalled before NVM4W can be installed (otherwise the PATH
environment variable is typically not updated properly). The installer identifies this, but if you're using an old version, installing manually, or simply skipped over this in the install, you'd see this issue.
Sorry, I wasn't clear. I don't have any other Node installs besides the nvm ones. I experienced and fixed my issue with only nvm installed.
this is happening for me as well, checking the environment variables I have NVM_HOME
pointing to C:\ProgramData\nvm
and NVM_SYMLINK
pointing to C:\Program Files\nodejs
, but that folder doesn't exist but the symlink in powershell does work pointing to v8.15.0 inside of the nvm folder. looks like something ain't getting wired correctly though as if I type node64 (which is the executable inside the node folder) then it works but node alone doesn't. also just to be cleared, this was working before the October update and it stopped after the update. I don't have any other version of node installed in the computer, and to confirmed, I just reseted my Surface Go and same problem again.
looks like renaming from node64 to node makes everything work again, including the listing properly (selecting which one is selected and which one is not) something that was not working. don't know who's problem is this, nvm or node installer that decided to call node 64. either way renaming the executables make everything work again.
My prior comments were directed to @mikeattara (regarding prior installations of Node).
I'm honestly not sure why @magneticflux- was experiencing the exec format error. It's not a very helpful error (it's a system error), so I'm not sure if it's a config issue or an environment issue.
@samiq - symlinks don't always show up as a folder if you're viewing it in Explorer (this is a setting). The renaming issue is an nvm4w thing, but it should be renaming properly. Given the resets you did, it's possible permissions changed, which can prevent a file from being renamed.
Finally, if you want to manually validate your installation, I've put together a short screenshot guide at https://github.com/coreybutler/nvm-windows/wiki/Hacking#validating-installation. Hopefully that will help.
@coreybutler Thanks for your assistance. I have resolved the problem. I have added learning Go to my 2019 to-do list so I can contribute to this project.
@coreybutler I run the installs always from a power shell with admin permissions to make sure I don鈥檛 end up with permissions issues, don鈥檛 know if that would help, as I said, after checking everything; I think what stopped working was the renaming to node from node64
@samiq - I agree, I think your issue was the renaming. I just don't know why it refused to rename properly. It sounds like you did everything right (admin perms, etc). It's possible it was a fluke.... but even flukes have reasons.
I'm going to close this issue since the OP issues seems to be resolved, but feel free to open a new one if the renaming problem persists.
Most helpful comment
I had this error and I solved it by uninstalling all Node versions and reinstalling them. I had one v9, two v10, and two v11 versions and the latest (v11.6.0) wasn't working after installing it.
Edit: This was the error I received, but I got the same error as above when using PowerShell:
zsh: exec format error: node
.