Reputation: 10818
I have node 5.1 installed but in order to build some projects I need node 4 installed in order to do that. When I donwloaded the node 4 installer it is says that I have newer version already installed:
Upvotes: 1
Views: 108
Reputation: 623
If you want to keep your Windows environment, use a Node version manager- for instance Nodist: https://github.com/marcelklehr/nodist It will allow you to choose the version you require for your different projects.
Upvotes: 0
Reputation: 53850
I would use Docker and run different Node versions inside separate containers, start and stop when needed.
Look at the official Node repo https://hub.docker.com/_/node/. There are all versions from 0.10 to 5.1.1 available.
Inside the project folder where you need a specific Node version, create a Dockerfile
file and put this in:
FROM node:5.1.1
EXPOSE 8000 // The port on which your Node app runs
Then build the image from this config file by running:
$ docker build -t yourappname .
Finally run it:
$ docker run -it --rm --name yourappinstance yourappname
For another project you do the same except specifying a different Node version.
Upvotes: 2