I'm trying to learn Angular using asp.net core 2.0, since I have no experience with Node.js I'm trying to set up my environment using nvm, which I installed using chocolatey (just in case it makes a difference), as recommended by a friend, the tutorial I'm following tells me to use node 6.9.0 and have installed it and set it as active:
nvm install 6.9.0
nvm ls
nvm use 6.9.0
and I get the proper message telling me 6.9.0 is the active version. However when I do:
node --version
I get
v8.10.0
I use Visual Studio 2017 Pro for my everyday work, and I know it comes with its own version of node and I'm guessing that's what I'm seeing here and probably nvm will have no control over it as it not shown on the list of installed versions, and I know I haven't installed it myself. So my questions are:
What do I have to do to use the version I set with nvm?
Once I have that ready, what do I need to do to have VS use that version instead of its own?
I just worked out how to fix this, I'm posting an answer to help anyone else struggling with this, apparently, VS (or maybe myself :-( ) installed node directly and the one sitting on C:\Program Files\Nodejs was indeed version 8.10.0 and nvm was unable to change override it, so I just uninstalled the standalone node and ran the above commands on nvm and it worked like a charm.
Related
I had problem with create-react-app and turned out I gotta update my version of nodeJS. The thing is that I can't do so. when I type node --version I get v11.10.0, however when I type sudo n stable, I get:installed : v10.16.3 (with npm 6.9.0).
However when checking version of node I all time get this 11.10.0. How can I get this last stable version 10.16.3?
EDIT: SOLVED
turned out nvm was installed on laptop and it controled node version
I would suggest you use nvm to manage your node versions. It allows you to download multiple versions and you can assign versions on a per project basis. It also allows you to choose which version you want as default
Install nvm it will allow you to install and use any version you want.
Installation steps on ubuntu 18.04
I want to use an older version of Node.js in my application, and for that I have attempted to use nvm so that I can change the version accordingly.
Now I have three versions of Node.js and want to switch on specific version
nvm use [selected version]
It is successfully executed but the version is not updated
Example of use:
If your nvm command not updating your node version in windows, for example
Your current version is 6.11.2 and you would like to update to 8.11.3 using nvm use 8.11.3 in windows OS then below hack will do that job.
Renamed C:\Program Files\nodejs to C:\Program Files\nodejsx it worked for me.
Credit goes to user ituasdu
From the readme of NVM, under important notes:
Note: nvm does not support Windows (see #284). Two alternatives exist, which are neither supported nor developed by us:
nvm-windows
nodist
I remember I have upgraded to node.js v8.0.0.
And when I type node --version I see version number is v8.0.0.
However when I use which node on my OS X I see the path is /usr/local/Cellar/node/7.7.1/bin/node. Why would that happen? Am I using v8.0.0?
How did you install node?
Seems like you have used brew to install node in the past, but then upgraded in some other way.
In any case, you should trust the node --version, since this is node itself reporting.
If still in doubt, I would remove and reinstall.
Sounds like you have installed one version with Homebrew and one by normal installer?
Depending on your setup you can either remove the 7x version from Homebrew, or update and link to the correct version in Homebrew.
https://github.com/Homebrew/brew/blob/master/docs/FAQ.md#can-i-install-my-own-stuff-to-usrlocal
I installed Node.js from (https://nodejs.org/dist/latest-v5.x/node-v5.12.0-x64.msi), but the issue is , its showing version v0.12.2 instead of v5.12.0 which is required.
I try to update the node.js 5.2 installer but still showing version v0.12.2.
I have uninstalled Node.js and reinstall node-v5.12.0-x64.msi but still it’s not updated. Due to this am not able to run further commands for Ionic environmental setup.
Open a terminal and type where node
It should point to an old version of node (v0.12.2) still installed on your computer, for example C:\bin\node.
As Node.js is portable, you can have multiple versions on your computer.
If it cannot be uninstalled, simply delete C:\bin\node folder.
Then:
Open Windows System Properties/Advanced system properties
Click on Environment variables and edit PATH variable
Remove inside its value the path of the old version of node (C:\bin\node in our example).
Re-install Node v5.
Close your terminal and open a new one then type where node, it should point to Node.js v5
Most likely, you have an old Node version for x86 platform, and you are installing a newer version for 64 bit. Remove the path to the x86 from the Paths env variable, or move it to after the 64 bit path.
Solution:
List node.js installatios using nvm:
nvm ls
High chance the version you tried to install is also listed
Select the version to use using nvm
nvm use
(Not a direct solution)
You can try to install using nvm
Uninstall nodejs and follow the instruction from https://github.com/coreybutler/nvm-windows
I tried to install the latest version of NodeJS (v6.9.1 LTS and v7.1.0 Current) but I can't , ieven when I uninstall the nodeJS and install it again , I stuck with v0.12.2?
As a .net programmer , I need to instal visual studio 2015 , and I see the nodeJS v0.12.2 appears after I installed visual studio 2015.
anyone has any idea ?
Version v0.12.2 comes as a 32 bit installation with one of the Microsoft tools and it being in the path is picked up preferentially. To upgrade, install the 32 bit version of the nodejs from the official site. The path for this EXE is c:\Program Files(x86)\Nodejs
Once this is updated, you can uninstall the 32 bit version and install 64 bit version if needed.
I'm not sure how VS plays with NVM, but I'd recommend trying NVM: https://github.com/creationix/nvm
It lets you install multiple versions of Node.js. This is essential for a developer working on multiple Node projects which run different node versions.
nvm install 7.1
nvm use 7.1
node -v
> version 7.1
nvm install 4.4.9
nvm use 4.4.9
node -v
> version 4.4.9
You don't explain what you mean by "but I can't" - do you get any errors?
Since this question has too little details to answer I can only suspects what can be wrong. I suspect that you are installing the newer version of Node but the old is still a default. You need to set your PATH to include the path to the new Node earlier than the path to the old Node.
There are hundreds of tutorials online on how to install Node. Follow one of them and just make sure that your PATH is set up correctly.
it's a bit silly solution, but that's how it works for me.
Solution: Now I'm using Visual studio 2017 - the problem doesn't occur anymore!
basically I just upgrade to Visual Studio 2017 (clean install actually)