So this is a very weird one. Let me start by saying that things used to work fine.
I installed Node a few days ago and once complete I opened a command prompt (On Windows 10), I entered node --version
and it returned the current installed version.
I have since needed to have two different versions of Node that I can switch between. Enter our hero NVM. So I installed NVM, I set the nvm install path to C:\nvm
and ran the commands to install the different versions of Node I require.
Using the nvm command nvm use X.XX.XX
, replacing the X's with the version number, appears to work as it creates a symlink and points to the correct files via the link. Meaning if I manually go to the symlink and click it, I am taken to the Node installation folder, so I know the symlink is working.
Ignoring the symlink for now if I open command prompt from the node install location c:\nvm\v16.0.0
for example I can run node --version
and it will return the version correctly.
- Note: I did not add the .exe on the end of the call to node
C:\nvm\v16.0.0>node --version
v16.0.0
This is where things get a bit weird. If I update the environment variable PATH to have a entry for c:\nvm\16.0.0
and then just run node --version
I get the following error.
C:\>node --version The system cannot find the path specified
What is confusing me is that if I just add the.exe on then everything works fine???
C:\>node.exe --version
v16.0.0
I have checked that .exe is on the PATHEXT
environment variable.
Running other exe's work fine. I can type notepad
in the command prompt and it opens a new instance just fine.
Im really lost for ideas here. I have uninstalled, reinstalled, rebooted, shutdown, removed all Environment variables, added all Environment variables, created my own EXE's etc. etc. Everything works except for Node needing to be called with its extension before it will execute and yes.... I did check there is only one file called node and its not getting confused between an exe and a bat file
Would really apricate any help on this one guys. Thanks!
{}
buttondir
in s cmd window ... the content of the environment dialog box can be copied and pasted .... format everything as "code" by appending ``` on a separate line before and after the text