Git Product home page Git Product logo

nvm-windows's Introduction

Notice: We have started full time work on Runtime, the successor to NVM for Windows.

Complete this form to provide your thoughts and sign up for progress updates


NVM for Windows

The Microsoft/npm/Google recommended Node.js version manager for Windows.
This is not the same thing as nvm! (expand for details)

The original nvm is a completely separate project for Mac/Linux only. This project uses an entirely different philosophy and is not just a clone of nvm. Details are listed in Why another version manager? and what's the big difference?.

Download Now GitHub tag (latest SemVer) GitHub Release Date GitHub all releases Discuss Twitter URL

Sponsors
 

Can't sponsor?
Consider nominating @coreybutler for a Github star.

Running into issues? See the common issues wiki.

Seeking Feedback:

We're working on Runtime (rt), the successor to NVM For Windows. Please contribute by taking a minute to complete this form. Thank you!

Overview

Manage multiple installations of node.js on a Windows computer.

tl;dr Similar (not identical) to nvm, but for Windows. Has an installer. Download Now!

This has always been a node version manager, not an io.js manager, so there is no back-support for io.js. Node 4+ is supported. Remember when running nvm install or nvm use, Windows usually requires administrative rights (to create symlinks).

NVM for Windows

There are situations where the ability to switch between different versions of Node.js can be very useful. For example, if you want to test a module you're developing with the latest bleeding edge version without uninstalling the stable version of node, this utility can help.

Switch between stable and unstable versions.

Installation & Upgrades

⭐ ⭐ Uninstall any pre-existing Node installations!! ⭐ ⭐

The simplest (recommended) way to get NVM for Windows running properly is to uninstall any prior Node installation before installing NVM for Windows. It avoids all of the pitfalls listed below. However; you may not wish to nuke your Node installation if you've highly customized it. NVM for Windows can assume management of an existing installation, but there are nuances to this (dependent entirely on the permissions of the user running the installation). If you have an administrative account, it's relatively safe to install NVM for Windows before uninstalling the original Node version. If you are working in a closed environment, such as a corporate Active Directory environment where installations/uninstallations are controlled by group policy, you should really consider removing the original version of Node before installing NVM4W.

Permission Problems For security reasons, Windows will not allow an application from one vendor to "uninstall" an application from a different vendor. The official NVM4W installer will attempt assume management of an existing installation of Node., but it cannot actually uninstall the original Node.js version. To work around this, NVM for Windows installer attempts to copy the original Node.js installation files to the NVM root. This includes global npm modules and configurations. Once this process is complete, the original Node.js installation can be uninstalled without losing data.

PATH Installation Problems If you attempt to configure the NVM_SYMLINK to use an existing directory (like C:\Program Files\nodejs), it will fail because a symlink cannot overwrite a physical directory. This is not a problem if you choose a different symlink path (such as C:\nvm\node).

PATH Conflicts If you do not uninstall the original version, running nvm use may appear to do nothing at all. Running node -v will always show the original installation version. This is due to a PATH conflict that presents when the same application is installed multiple times. In NVM4W 1.1.11+, run nvm debug to determine if you have a PATH conflict.

For simplicity, we recommend uninstalling any existing versions of Node.js before using NVM for Windows. Delete any existing Node.js installation directories (e.g., %ProgramFiles%\nodejs) that might remain. NVM's generated symlink will not overwrite an existing (even empty) installation directory.

👀 Backup any global npmrc config 👀 (e.g. %AppData%\npm\etc\npmrc)

Alternatively, copy the settings to the user config %UserProfile%\.npmrc. Delete the existing npm install location (e.g. %AppData%\npm) to prevent global module conflicts.

Install nvm-windows

Use the latest installer (comes with an uninstaller). Alternatively, follow the manual installation guide.

If NVM4W doesn't appear to work immediately after installation, restart the terminal/powershell (not the whole computer).

NVM for Windows Installer

Reinstall any global utilities

After install, reinstalling global utilities (e.g. yarn) will have to be done for each installed version of node:

nvm use 14.0.0
npm install -g yarn
nvm use 12.0.1
npm install -g yarn

Upgrading nvm-windows

💡 As of v1.1.8, there is an upgrade utility that will automate the upgrade process.

To upgrade nvm-windows, run the new installer. It will safely overwrite the files it needs to update without touching your node.js installations. Make sure you use the same installation and symlink folder. If you originally installed to the default locations, you just need to click "next" on each window until it finishes.

Usage

nvm-windows runs in an Admin shell. You'll need to start powershell or Command Prompt as Administrator to use nvm-windows

NVM for Windows is a command line tool. Simply type nvm in the console for help. The basic commands are:

  • nvm arch [32|64]: Show if node is running in 32 or 64 bit mode. Specify 32 or 64 to override the default architecture.
  • nvm debug: Check the NVM4W process for known problems.
  • nvm current: Display active version.
  • nvm install <version> [arch]: The version can be a specific version, "latest" for the latest current version, or "lts" for the most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch). Set [arch] to "all" to install 32 AND 64 bit versions. Add --insecure to the end of this command to bypass SSL validation of the remote download server.
  • nvm list [available]: List the node.js installations. Type available at the end to show a list of versions available for download.
  • nvm on: Enable node.js version management.
  • nvm off: Disable node.js version management (does not uninstall anything).
  • nvm proxy [url]: Set a proxy to use for downloads. Leave [url] blank to see the current proxy. Set [url] to "none" to remove the proxy.
  • nvm uninstall <version>: Uninstall a specific version.
  • nvm use <version> [arch]: Switch to use the specified version. Optionally use latest, lts, or newest. newest is the latest installed version. Optionally specify 32/64bit architecture. nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode. For information about using use in a specific directory (or using .nvmrc), please refer to issue #16.
  • nvm root <path>: Set the directory where nvm should store different versions of node.js. If <path> is not set, the current root will be displayed.
  • nvm version: Displays the current running version of NVM for Windows.
  • nvm node_mirror <node_mirror_url>: Set the node mirror.People in China can use https://npmmirror.com/mirrors/node/
  • nvm npm_mirror <npm_mirror_url>: Set the npm mirror.People in China can use https://npmmirror.com/mirrors/npm/

⚠️ Gotcha!

Please note that any global npm modules you may have installed are not shared between the various versions of node.js you have installed. Additionally, some npm modules may not be supported in the version of node you're using, so be aware of your environment as you work.

📛 Antivirus

Users have reported some problems using antivirus, specifically McAfee. It appears the antivirus software is manipulating access to the VBScript engine. See issue #133 for details and resolution.

v1.1.8 is not code signed, but all other versions are signed by Ecor Ventures LLC/Author.io. This should help prevent false positives with most antivirus software.

v1.1.8+ was not code signed due to an expired certificate (see the release notes for reasons). v1.1.9 is code signed thanks to ajyong, who sponsored the new certificate.

Using Yarn

tldr; npm i -g yarn

See the wiki for details.

Build from source

  • Install go from http://golang.org
  • Download source / Git Clone the repo
  • Change GOARCH to amd64 in build.bat if you feel like building a 64-bit executable
  • Fire up a Windows command prompt and change directory to project dir
  • Execute go get github.com/blang/semver
  • Execute go get github.com/olekukonko/tablewriter
  • Execute build.bat
  • Check the distdirectory for generated setup program.

💡 Why another version manager?

There are several version managers for node.js. Tools like nvm and n only run on Mac OSX and Linux. Windows users are left in the cold? No. nvmw and nodist are both designed for Windows. So, why another version manager for Windows?

The architecture of most node version managers for Windows rely on .bat files, which do some clever tricks to set or mimic environment variables. Some of them use node itself (once it's downloaded), which is admirable, but prone to problems. Right around node 0.10.30, the installation structure changed a little, causing some of these to just stop working with anything new.

Additionally, some users struggle to install these modules since it requires a little more knowledge of node's installation structure. I believe if it were easier for people to switch between versions, people might take the time to test their code on back and future versions... which is just good practice.

💡 What's the big difference?

First and foremost, this version of nvm has no dependency on node. It's written in Go, which is a much more structured approach than hacking around a limited .bat file. It does not rely on having an existing node installation. Go offers the ability to create a Mac/Linux version on the same code base. In fact, this is already underway.

The control mechanism is also quite different. There are two general ways to support multiple node installations with hot switching capabilities. The first is to modify the system PATH any time you switch versions, or bypass it by using a .bat file to mimic the node executable and redirect accordingly. This always seemed a little hackish to me, and there are some quirks as a result of this implementation.

The second option is to use a symlink. This concept requires putting the symlink in the system PATH, then updating its target to the node installation directory you want to use. This is a straightforward approach, and seems to be what people recommend.... until they realize just how much of a pain symlinks are on Windows. This is why it hasn't happened before.

In order to create/modify a symlink, you must be running as an admin, and you must get around Windows UAC (that annoying prompt). Luckily, this is a challenge I already solved with some helper scripts in node-windows. As a result, NVM for Windows maintains a single symlink that is put in the system PATH during installation only. Switching to different versions of node is a matter of switching the symlink target. As a result, this utility does not require you to run nvm use x.x.x every time you open a console window. When you do run nvm use x.x.x, the active version of node is automatically updated across all open console windows. It also persists between system reboots, so you only need to use nvm when you want to make a change.

NVM for Windows comes with an installer, courtesy of a byproduct of my work on Fenix Web Server.

Overall, this project brings together some ideas, a few battle-hardened pieces of other modules, and support for newer versions of node.

NVM for Windows recognizes the "latest" versions using a list provided by the Node project. Version 1.1.1+ use this list. Before this list existed, I was scraping releases and serving it as a standalone data feed. This list was used in versions 1.1.0 and prior, but is now deprecated.

Motivation

I needed it, plain and simple. Additionally, it's apparent that support for multiple versions is not coming to node core. It was also an excuse to play with Go.

Why Go? Why not Node?

I chose Go because it is cross-platform, felt like less overhead than Java, has been around longer than most people think. Plus, I wanted to experiment with it. I've been asked why I didn't write it with Node. Trying to write a tool with the tool you're trying to install doesn't make sense to me. As a result, my project requirements for this were simple... something that's not Node. Node will continue to evolve and change. If you need a reminder of that, remember io.js, Ayo, all the breaking changes between 4.x.x and 6.x.x, and the shift to ES Modules in 12+. Change is inevitable in the world of software. JavaScript is extremely dynamic.

🙏 Thanks

Thanks to everyone who has submitted issues on and off Github, made suggestions, and generally helped make this a better project. Special thanks to

  • @vkbansal, who provided significant early feedback throughout the early releases.
  • @rainabba and @sullivanpt for getting Node v4 support integrated.
  • @s-h-a-d-o-w who resolved the longstanding space escaping issue in path names (#355).
  • ajyong who sponsored the code signing certificate in late 2021.

Contributors

nvm-windows's People

Contributors

coreybutler avatar dependabot[bot] avatar excited-ccccly avatar fredericrous avatar gitter-badger avatar jchitel-ds avatar lijie371 avatar mscott3 avatar narve avatar nineninesevenfour avatar noelhibbard avatar psnitil avatar rahulroy9202 avatar rainabba avatar rbuckton avatar rcknight avatar readmecritic avatar riazxrazor avatar romualdr avatar ryanclarke avatar s-h-a-d-o-w avatar sitiom avatar sullivanpt avatar taaem avatar tathamoddie avatar tats-u avatar tester798 avatar tomashubelbauer avatar tomisawk avatar veleek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvm-windows's Issues

So confusing...

~/Documents/Workspace
$ nvm install v0.12.0
Node.js vv0.12.0 is only available in 32-bit.

~/Documents/Workspace
$ nvm install 0.12.0
Downloading node.js version 0.12.0 (64-bit)... Complete
Downloading npm version 2.5.1... Complete
Installing npm v2.5.1...

Installation complete. If you want to use this version, type

nvm use 0.12.0

Tested with proxies?

I am having trouble getting nvm-windows to work with my proxy.

From the nvm settings.txt file, I see that it has set everything in the proxy URL to lower case. That trashed my password and ID.
Second, when I manually edit the settings file (and then verify the proxy URL from the command line), it still fails with a message stating that proxy authentication is required.

I am using a proxy URL of the form http://userid:[email protected]:port#

This same string works in npm and git. Does your implementation expect something different?

'npm link' issue with yeoman generator

Hello,

I was trying to use latest version of yeoman jhipster generator, this implies to run 'npm link' in the generator source directory, everything seems to work fine (link has been created) but it fails when I try to use it.

It works well when not using nvm.

Here is how to reproduce the error with Node 0.10.35 on Windows 7 64bit

git clone https://github.com/jhipster/generator-jhipster.git
cd generator-jhipster
npm link

npm install -g yo
yo jhipster
Error jhipster

You don't seem to have a generator with the name jhipster installed.
You can see available generators with npm search yeoman-generator and then insta
ll them with npm install [name].
To see the 0 registered generators run yo with the `--help` option.

Bug when choosing custom install location

When I select an install location fro nvm other than c:\users{user}\AppData\Roaming\nvm the CLI crashes with:

unable to find c:\users\{user}\AppData\Roaming\nvm\settings.txt

nvm use not work

video -> http://www.youtube.com/watch?v=L9rSo6e32yM

C:\Windows\system32>nvm

Running version 1.0.6.

Usage:

  nvm arch                     : Show if node is running in 32 or 64 bit mode.
  nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable version.
                                 Optionally specify whether to install the 32 or 64 bit version (defaults to system arch).
                                 Set [arch] to "all" to install 32 AND 64 bit versions.
  nvm list [available]         : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
  nvm on                       : Enable node.js version management.
  nvm off                      : Disable node.js version management.
  nvm proxy [url]              : Set a proxy to use for downloads. Leave [url] b lank to see the current proxy.
                                 Set [url] to "none" to remove the proxy.
  nvm uninstall <version>      : The version must be a specific version.
  nvm use [version] [arch]     : Switch to use the specified version. Optionally specify 32/64bit architecture.
  nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
  nvm root [path]              : Set the directory where nvm should store different versions of node.js. If <path> is not set, the current root will bedisplayed.
  nvm version                  : Displays the current running version of nvm for Windows. Aliased as v.


C:\Windows\system32>nvm list

    0.11.14
    0.11.11
  * 0.10.32 (Currently using 64-bit executable)

C:\Windows\system32>nvm use 0.11.11
Now using node v0.11.11 (64-bit)

C:\Windows\system32>node -v
v0.10.32

C:\Windows\system32>nvm install 0.11.11 64
Version 0.11.11 is already installed.

C:\Windows\system32>nvm install 0.11.11 32
Downloading node.js version 0.11.11 (32-bit)...
C:\Windows\system32>nvm install 0.10.33
Downloading node.js version 0.10.33 (64-bit)... Complete

Could not retrieve https://raw.githubusercontent.com/coreybutler/nodedistro/mast
er/nodeversions.json.


Get https://raw.githubusercontent.com/coreybutler/nodedistro/master/nodeversions
.json: EOF
C:\Windows\system32>nvm list

    0.11.14
    0.11.11
    0.10.33
  * 0.10.32 (Currently using 64-bit executable)

C:\Windows\system32>nvm install 0.10.33 32
Downloading node.js version 0.10.33 (32-bit)... Complete
Downloading npm version 1.4.28... Complete
Installing npm v1.4.28...

Installation complete. If you want to use this version, type

nvm use 0.10.33

C:\Windows\system32>nvm list

    0.11.14
    0.11.11
    0.10.33
  * 0.10.32 (Currently using 64-bit executable)

C:\Windows\system32>node -v
v0.10.32

C:\Windows\system32>nvm use 0.10.33
Now using node v0.10.33 (64-bit)

C:\Windows\system32>node -v
v0.10.32

C:\Windows\system32>

can't install certain versions of nodejs

I'm on windows 8.1. When I tried to install a fairly old version of node, I ran into this:
image
As I checked, 0.8.28 is in the list. And it seems that version 0.9.x and older ones are all unavailable now. But 0.12.0 and 0.10.x are installed properly.

nonadmin command window does not find nvm

On Windows 8.1 with all patches, I have experienced that nvm does not find nvm in a nonadmin window.

I've debugged it to be caused by the existence of NVM_HOME and NVM_SYMLINK in the user environment variable list. When I remove them from the user list and allow them to only exist in the system list, a nonadmin window properly finds nvm via the PATH.

Chocolatey Package

NVM is awesome, saves my time, another program I use is chocolatey, with this package manager you can install easily windows programs.

I wish register nvm in chocolatey but I need the permission to do this.

Misleading installer instruction

I just learned about nvm-windows when googling for a convenient way to update node (on Windows) and it seems to be just what I need!

However, it wouldn't play at first and it took me a while to figure out why. In the installer I changed the default paths to my liking (which I almost always do), but I misunderstood the instruction that says "Select the folder in which Setup should create the symlink" (see screenshot below) and I chose an existing folder.

The installation completed without problems and (after changing some permissions) I could run nvm install latest to install version 0.10.35. Then I tried to run nvm use 0.10.35. It gave me an UAC prompt (like it's supposed to?) and then failed silently - no symlink created!

It wasn't obvious (at least to me) that the reason was that I had entered a path to an existing directory (since I thought that was what the installer asked for). You should really rephrase that instruction in the installer and perhaps also output a descriptive error message if there is a folder in the way when creating the symlink.

screen

nvm use *version* not properly switching after install with aptana terminal

I've been using nvm-windows successfully for a few weeks. For a while I only had 0.10.32 installed. I primarily use Aptana terminal inside eclipse IDE.

node just released 0.10.33 recently, so, using the terminal inside eclipse:

nvm list

showed that I was using 0.10.32 (only version that was installed).

then
nvm install latest

Once it displayed that npm and node had been installed,

$ nvm use 0.10.33
Now using node v0.10.33

I then issued the following commands, and receieved the results:

fhgjgbie

It might be of note that I was using 0.10.32 fine before this inside the same terminal. Anyways. after that, I opened up the windows command prompt:

capture

Note no asterisk in the nvm list.

After that I went back to eclipse (did NOT restart it), and everything ran fine, as it should.

I do not know if this is a "bug," or if it can be duplicated. Just simply describing my issue.

Easier No-Install instructions

We should be using powershell/CLI in the wiki/scripts to assist the user.
Create an "install.cmd" file with these lines:

setx /m NVM_HOME "C:\nvm"
setx /m NVM_SYMLINK "C:\Program Files\nodejs"
setx /m PATH "%PATH%;%NVM_HOME%;%NVM_SYMLINK%"
(echo root: C:\nvm && echo path: C:\Program Files\nodejs && echo arch: 64 && echo proxy: none) > C:\nvm\settings.txt
notepad C:\nvm\settings.txt

Install problem(s)

Ok, I'm having a lot of issues, but I would LOVE to get this working on my windows desktop instead of my older mac laptop. Thanks very much in advance for creating nvm for windows! I'm using Win7 64-bit.

The installer puts the files in my username\AppData\Roaming folder by default. Is this correct behavior? If these files follow me to another windows computer, will everything still work?

When cmd.exe is run at the end of the installer, it complains about a missing \settings.txt, even though it is present. If I close that cmd.exe and start a new one, the error message goes away. (Possibly the cmd.exe launched from the installer has not yet picked up the new %path% environment variable?)

Even though the '\settings.txt' error message has gone away from subsequent cmd.exe invocations, the path is still not set up properly-- %NVM_HOME% and %NVM_SYMLINK% are listed when I inspect the path from the command line. (I mentioned this in another issue thread. Workaround is to add the proper dirs to the path manually a la "set path=%path%;%nvm_home%;%nvm_symlink%").

When I open up Win7's 'Environment Variables' dialog box, it looks like the two nvm-windows variables are both in my User Variables as well as my System Variables. I'm not used to seeing variables duplicated like that.

Running "nvm use [...]" causes two separate windows security dialogs to open due to making changes to the symlink in \Program Files.

I run "nvm install 0.10.33" and it seems to work, but only after I run "nvm use ..." which is a little odd since this is the first and only node.js I've installed thus far. But maybe that's how the 'nix versions work.

When I then install another node.js, 0.11.14, install succeeds. When I "run nvm use 0.11.14" that works too. And when I run "nvm list" I can see my two installed versions, although I'm seeing "?-bit executable" instead of "64-bit".

When I try and switch from 0.11.14 to 0.10.33, I get the error "node v0.10.33 (64-bit) is not installed." I get a similar error when I run "nvm use 0.11.14".

So then I run the uninstaller for nvm-windows in the control panel. For some reason a new PATH variable is now added to my User variables where none was there before. It appears to be a copy of my System variable PATH. So now when I open a cmd.exe, my PATH is doubled in size and content. (Deleting my User variable for PATH fixes this.)

common global modules

I use version A and install a package (say coffeelint) globally. Then I switch to version B. The previously installed package (coffeelint) is not available with version B. So I Need to install it all over again.

C:\> nvm use 0.10.33
C:\> npm install -g coffeelint
C:\> coffeelint -v
1.6.1
C:\> nvm use 0.10.32
C:\> coffeelint -v
'coffeelint' is not recognized as an internal or external command,
operable program or batch file.

Without nvm, npm installs global packages to C:\Users\[username]\AppData\Roaming\npm. But with nvm, it install in C:\Users\[username]\AppData\Roaming\nvm\[version]\npm_modules.

Is there a way to change this behaviour?

npm ls -g lists npm

I noticed that npm ls -g lists npm itself (with all its dependencies) now that I've installed Node via nvm. When I had Node installed the "normal" way it didn't (which I've just verified with a colleague). It seems to work fine otherwise (though I haven't tested it that much yet), but the fact that it behaves differently is a bit disturbing.

Do you know why and are there any other differences?

Add environment integrity check

To prevent confusion (see issue #24) and provide direction, there should be an environment integrity check, such as nvm check, complete with autofixes (whenever possible).

Autodetect Platform

Autodetect 32 vs 64 bit platforms.

  • Use os.Getenv("PROCESSOR_ARCHITECTURE") to automatically detect 32 vs 64 bit architecture.
  • Add a line in the settings.txt to allow override
  • Add a flag to quickly switch the architecture

Issue with setting node version

I have installed nvm under the path:
C:/Program Files/nvm

After installing I ran the following command to install latest version of node:
nvm install latest all

I then ran the following command to set the node version I wanted to use:
nvm use v0.10.34

It showed the following error message
error

From the error message I think the issue is that the file path to nvm/node contains space i.e. the space in the between "Program Files" of the file path where I have installed them.

Running the following command also threw a similar error:
error1

I presume the file paths cannot handle spaces between them. A simple fix on this would be great.

when install in another partition npm is not working

when i install the nvm in d:\nvm
and use nvm install latest 32 to install node
it seems npm is not installed properly
the node_modules under the latest installed node is empty
i view the code, and the problem seem to be
this line in nvm.go:

os.Rename(os.TempDir()+"\\nvm-npm\\npm-"+npmv,env.root+"\\v"+version+"\\node_modules\\npm")

it seems using os.Rename to rename directories between different partitions is not working properly
issue #24 may be related

Issue with blank spaces in path

Hello! I'm having a problem when i'm trying nvm use <node_version>
captura
Sorry for the spanish language in screenshot. It means "c:\Users\Edu" is not recognise as an internal command... bla bla bla.
My user name is "Edu Martin" and my path is "c:\Users\Edu Martin\AppData\Roaming\nvm"
Is it possible to be an error with black spaces in the path?? All settings in my app are standard

Windows Server Core Support

Installer fails on Windows Server Core with error: 1060.

I feel that nvm support for server-core is important for real-world use and testing.
Maybe nvm should not use an installer, but a portable executable instead?

Node v#.##.## not installed

I am a newbie on this so bare with me.

Trying to switch between node installations does not work. When using nvm list it shows all the installed versions.
image

But when trying to switch to another version, it says it is not installed.
image

I figured I was doing something wrong so I tried to specify an architecture. Still nothing.
image

But if I keep re-installing then switching, then it works.

Running Windows 8.1
nvm installed on c:
root set to c:\nvm

Issue #30 maybe related.

And thanks btw for this. Really great piece of software @coreybutler .

Ability to use nvm to launch a specific version of node.

Although one could use batch files for this, and just accept that the symlink will swap around... it would be nice if one could nvm (version) -run somescript or similar for executing npm scripts with a specific version of node... with everything after the -run passed to node as parameters... nvm 0.11.10 -run --harmony my-new-tool.js as an example.. because I'm moving towards doing new projects with 0.11 and older ones still on 0.10, it would be nice to be able to set my services to use the appropriate version.

Better CLI

Look at nodist CLI:

Usage:

    nodist                          List all installed node versions.
    nodist list
    nodist ls

    nodist dist                     List all available node versions.
    nodist ds

    nodist add <version>            Download the specified node version.
    nodist + <version>

    nodist rm <version>             Uninstall the specified node version.
    nodist - <version>

    nodist <version>                Use the specified node version globally
    nodist global <version>         (downloads the executable, if necessary).

    nodist use <version>            Use <version> in the current environment only
    nodist env <version>            (usually the current terminal window).

    nodist local <version>          Use <version> in this directory and its subdirectories.
                                    (will add a ./node-version file)

    nodist args <version> <args..>  Set command line args that will always be passed
                                    to this version (e.g. --harmony-generators or v8 tweaks).
                                    Omit <args..> to reset.

    nodist run <version> -- <args..>    Run <args> with the specified node version
    nodist r <version> -- <args..>      (downloads the executable, if necessary).

    nodist bin <version>            Get the path to the specified node executable
                                    (downloads the executable, if necessary).

    nodist path <version>           Get the path to the specified node version directory
                                    (downloads the executable, if necessary).

    nodist selfupdate               Update nodist's dependencies.

    nodist --help                   Display this help

    nodist -v                       Display nodist version

Examples:

    nodist 0.8.1                    Use node v0.8.1 globally

    nodist v0.5.10                  Use node v0.5.10 globally

    nodist - 0.5.10                 Uninstall node v0.5.10

    nodist r v0.8.1 -- foo.js -s    Run `foo.js -s` with node v0.8.1, regardless
                                    of the global version

    nodist latest                   Use the latest available node version globally
                                    (downloads the executable, if necessary).

    nodist stable                   Use the latest stable available node version
                                    globally (downloads the executable, if necessary).

    nodist + all                    Installs *all* available node versions.
                                    (Get yourself a cuppa in the meantime...)

It's just so comfortable to use.

Apart of being able to change the node version globally as well as in the current terminal, it has a latest & stable shorthands accepted in both install and use commands, which is super helpful, as I don't have to constantly look up or remember current node versions.

Use command is default so you can do super quick commands like nodist latest or nodist stable to switch between latest and stable node versions.

In comparison, using nvm CLI is quite a pain.

why i failed to run nvm?

what's wrong?

C:\Windows\system32>nvm

ERROR open \settings.txt: The system cannot find the file specified.

C:\Windows\system32>nvm list available

ERROR open \settings.txt: The system cannot find the file specified.

Refusing to delete global module

Per @vkbansal (moved from issue #26):

I keep getting Error: Refusing to delete: C:\Program Files\nodejs\coffeelint.cmd not in C:\Program Files\nodejs. when I do npm install -g coffeelint. Any idea what may cause this ?

Here's npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'coffeelint' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 silly cache add args [ 'coffeelint', null ]
6 verbose cache add spec coffeelint
7 silly cache add parsed spec { raw: 'coffeelint',
7 silly cache add   scope: null,
7 silly cache add   name: 'coffeelint',
7 silly cache add   rawSpec: '',
7 silly cache add   spec: '*',
7 silly cache add   type: 'range' }
8 verbose addNamed coffeelint@*
9 silly addNamed semver.valid null
10 silly addNamed semver.validRange *
11 silly addNameRange { name: 'coffeelint', range: '*', hasData: false }
12 silly mapToRegistry name coffeelint
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry uri https://registry.npmjs.org/coffeelint
16 verbose addNameRange registry:https://registry.npmjs.org/coffeelint not in flight; fetching
17 verbose request uri https://registry.npmjs.org/coffeelint
18 verbose request no auth needed
19 info attempt registry request try #1 at 10:22:10
20 verbose request id 4d4b8cae84f08a01
21 verbose etag "3M75DKO5CKF5HR02T670OPLOU"
22 http request GET https://registry.npmjs.org/coffeelint
23 http 304 https://registry.npmjs.org/coffeelint
24 silly get cb [ 304,
24 silly get   { date: 'Mon, 15 Dec 2014 04:52:12 GMT',
24 silly get     server: 'Apache',
24 silly get     via: '1.1 varnish',
24 silly get     'last-modified': 'Mon, 15 Dec 2014 04:52:12 GMT',
24 silly get     'cache-control': 'max-age=60',
24 silly get     etag: '"3M75DKO5CKF5HR02T670OPLOU"',
24 silly get     age: '0',
24 silly get     'x-served-by': 'cache-sn88-SIN',
24 silly get     'x-cache': 'HIT',
24 silly get     'x-cache-hits': '1',
24 silly get     'x-timer': 'S1418619132.555107,VS0,VE198',
24 silly get     vary: 'Accept',
24 silly get     'content-length': '0',
24 silly get     'keep-alive': 'timeout=10, max=50',
24 silly get     connection: 'Keep-Alive' } ]
25 verbose etag https://registry.npmjs.org/coffeelint from cache
26 silly addNameRange number 2 { name: 'coffeelint', range: '*', hasData: true }
27 silly addNameRange versions [ 'coffeelint',
27 silly addNameRange   [ '0.0.1',
27 silly addNameRange     '0.0.2',
27 silly addNameRange     '0.0.3',
27 silly addNameRange     '0.0.4',
27 silly addNameRange     '0.0.5',
27 silly addNameRange     '0.0.6',
27 silly addNameRange     '0.0.7',
27 silly addNameRange     '0.1.0',
27 silly addNameRange     '0.2.0',
27 silly addNameRange     '0.3.0',
27 silly addNameRange     '0.4.0',
27 silly addNameRange     '0.5.0',
27 silly addNameRange     '0.5.1',
27 silly addNameRange     '0.5.2',
27 silly addNameRange     '0.5.3',
27 silly addNameRange     '0.5.4',
27 silly addNameRange     '0.5.5',
27 silly addNameRange     '0.5.6',
27 silly addNameRange     '0.5.7',
27 silly addNameRange     '0.6.0',
27 silly addNameRange     '0.6.1',
27 silly addNameRange     '1.0.0',
27 silly addNameRange     '1.0.1',
27 silly addNameRange     '1.0.2',
27 silly addNameRange     '1.0.3',
27 silly addNameRange     '1.0.4',
27 silly addNameRange     '1.0.5',
27 silly addNameRange     '1.0.6',
27 silly addNameRange     '1.0.7',
27 silly addNameRange     '1.0.8',
27 silly addNameRange     '1.1.0',
27 silly addNameRange     '1.2.0',
27 silly addNameRange     '1.3.0',
27 silly addNameRange     '1.4.0',
27 silly addNameRange     '1.4.1',
27 silly addNameRange     '1.5.0',
27 silly addNameRange     '1.5.1',
27 silly addNameRange     '1.5.2',
27 silly addNameRange     '1.5.3',
27 silly addNameRange     '1.5.4',
27 silly addNameRange     '1.5.5',
27 silly addNameRange     '1.5.6',
27 silly addNameRange     '1.5.7',
27 silly addNameRange     '1.6.0',
27 silly addNameRange     '1.6.1',
27 silly addNameRange     '1.7.0' ] ]
28 verbose addNamed [email protected]
29 silly addNamed semver.valid 1.7.0
30 silly addNamed semver.validRange 1.7.0
31 silly cache afterAdd [email protected]
32 verbose afterAdd C:\Users\hdev11\AppData\Roaming\npm-cache\coffeelint\1.7.0\package\package.json not in flight; writing
33 verbose afterAdd C:\Users\hdev11\AppData\Roaming\npm-cache\coffeelint\1.7.0\package\package.json written
34 silly install resolved [ { name: 'coffeelint',
34 silly install resolved     description: 'Lint your CoffeeScript',
34 silly install resolved     version: '1.7.0',
34 silly install resolved     homepage: 'http://www.coffeelint.org',
34 silly install resolved     keywords: [ 'lint', 'coffeescript', 'coffee-script' ],
34 silly install resolved     author: { name: 'Matthew Perpick', email: '[email protected]' },
34 silly install resolved     main: './lib/coffeelint.js',
34 silly install resolved     engines: { npm: '>=1.3.7', node: '>=0.8.0' },
34 silly install resolved     repository:
34 silly install resolved      { type: 'git',
34 silly install resolved        url: 'git://github.com/clutchski/coffeelint.git' },
34 silly install resolved     bin: { coffeelint: './bin/coffeelint' },
34 silly install resolved     dependencies:
34 silly install resolved      { 'coffee-script': '~1.7',
34 silly install resolved        glob: '^4.0.0',
34 silly install resolved        ignore: '^2.2.15',
34 silly install resolved        optimist: '^0.6.1',
34 silly install resolved        resolve: '^0.6.3' },
34 silly install resolved     devDependencies: { vows: '>=0.6.0', underscore: '>=1.4.4' },
34 silly install resolved     licenses: [ [Object] ],
34 silly install resolved     scripts:
34 silly install resolved      { pretest: 'cake compile',
34 silly install resolved        test: './vowsrunner.js --spec test/*.coffee test/*.litcoffee',
34 silly install resolved        posttest: 'npm run lint',
34 silly install resolved        prepublish: 'cake prepublish',
34 silly install resolved        publish: 'cake publish',
34 silly install resolved        lint: 'cake compile && ./bin/coffeelint .',
34 silly install resolved        'lint-csv': 'cake compile && ./bin/coffeelint --csv .',
34 silly install resolved        'lint-jslint': 'cake compile && ./bin/coffeelint --jslint .',
34 silly install resolved        compile: 'cake compile' },
34 silly install resolved     gitHead: 'abe43e69f0ecb34b439e7681d687c14fd7c496f4',
34 silly install resolved     bugs: { url: 'https://github.com/clutchski/coffeelint/issues' },
34 silly install resolved     _id: '[email protected]',
34 silly install resolved     _shasum: '84d01a7f0c0d5f532eece096a1603ee37c220634',
34 silly install resolved     _from: 'coffeelint@*',
34 silly install resolved     _npmVersion: '2.1.4',
34 silly install resolved     _nodeVersion: '0.10.28',
34 silly install resolved     _npmUser: { name: 'asaayers', email: '[email protected]' },
34 silly install resolved     maintainers: [ [Object], [Object], [Object] ],
34 silly install resolved     dist:
34 silly install resolved      { shasum: '84d01a7f0c0d5f532eece096a1603ee37c220634',
34 silly install resolved        tarball: 'http://registry.npmjs.org/coffeelint/-/coffeelint-1.7.0.tgz' },
34 silly install resolved     directories: {},
34 silly install resolved     _resolved: 'https://registry.npmjs.org/coffeelint/-/coffeelint-1.7.0.tgz',
34 silly install resolved     readme: 'ERROR: No README data found!' } ]
35 info install [email protected] into C:\Program Files\nodejs
36 info installOne [email protected]
37 verbose installOne of coffeelint to C:\Program Files\nodejs not in flight; installing
38 verbose lock using C:\Users\hdev11\AppData\Roaming\npm-cache\_locks\coffeelint-b593cebdb3430387.lock for C:\Program Files\nodejs\node_modules\coffeelint
39 silly install write writing coffeelint 1.7.0 to C:\Program Files\nodejs\node_modules\coffeelint
40 silly cache addNamed cb [email protected]
41 verbose unbuild node_modules\coffeelint
42 info preuninstall [email protected]
43 info uninstall [email protected]
44 verbose unbuild rmStuff [email protected] from C:\Program Files\nodejs\node_modules
45 verbose gentlyRm verifying that C:\Program Files\nodejs is managed by npm
46 silly cacheAndTest C:\Program Files\nodejs is not inside C:\Program Files\nodejs\node_modules
47 silly isManaged C:\Program Files\nodejs is not inside C:\Program Files\nodejs\node_modules
48 silly cacheAndTest C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
49 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
50 silly isManaged C:\Program Files\nodejs is not inside C:\Program Files\nodejs\node_modules
51 verbose isManaged no path
52 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
53 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
54 verbose gentlyRm C:\Program Files\nodejs is not managed by npm
55 verbose unlock done using C:\Users\hdev11\AppData\Roaming\npm-cache\_locks\coffeelint-b593cebdb3430387.lock for C:\Program Files\nodejs\node_modules\coffeelint
56 verbose stack Error: Refusing to delete: C:\Program Files\nodejs\coffeelint.cmd not in C:\Program Files\nodejs
56 verbose stack     at clobberFail (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\lib\utils\gently-rm.js:166:12)
56 verbose stack     at C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\lib\utils\gently-rm.js:56:14
56 verbose stack     at zalgoSafe (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\dezalgo\dezalgo.js:20:10)
56 verbose stack     at map (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\async-some\some.js:28:33)
56 verbose stack     at reduce (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\async-some\some.js:38:5)
56 verbose stack     at predicate (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\lib\utils\gently-rm.js:130:14)
56 verbose stack     at map (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\async-some\some.js:30:5)
56 verbose stack     at reduce (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\async-some\some.js:38:5)
56 verbose stack     at predicate (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\lib\utils\gently-rm.js:130:14)
56 verbose stack     at map (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\async-some\some.js:30:5)
57 verbose cwd E:\temp
58 error Windows_NT 6.2.9200
59 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "coffeelint"
60 error node v0.10.32
61 error npm  v2.1.9
62 error path C:\Program Files\nodejs\coffeelint.cmd
63 error code EEXIST
64 error Refusing to delete: C:\Program Files\nodejs\coffeelint.cmd not in C:\Program Files\nodejs
File exists: C:\Program Files\nodejs\coffeelint.cmd
Move it away, and try again.
65 verbose exit [ 1, true ]
66 verbose unbuild node_modules\coffeelint
67 info preuninstall [email protected]
68 info uninstall [email protected]
69 verbose unbuild rmStuff [email protected] from C:\Program Files\nodejs\node_modules
70 verbose gentlyRm verifying that C:\Program Files\nodejs is managed by npm
71 silly isManaged C:\Program Files\nodejs is not inside C:\Program Files\nodejs\node_modules
72 silly isManaged C:\Program Files\nodejs is not inside C:\Program Files\nodejs\node_modules
73 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
74 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
75 silly isManaged C:\Program Files\nodejs is not inside C:\Program Files\nodejs\node_modules
76 verbose isManaged no path
77 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
78 silly isManaged C:\Program Files\nodejs is not inside C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32
79 verbose gentlyRm C:\Program Files\nodejs is not managed by npm
80 error error rolling back Error: Refusing to delete: C:\Program Files\nodejs\coffeelint.cmd not in C:\Program Files\nodejs
80 error error rolling back     at clobberFail (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\lib\utils\gently-rm.js:166:12)
80 error error rolling back     at C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\lib\utils\gently-rm.js:56:14
80 error error rolling back     at C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\dezalgo\dezalgo.js:17:12
80 error error rolling back     at flush (C:\Users\hdev11\AppData\Roaming\nvm\v0.10.32\node_modules\npm\node_modules\dezalgo\node_modules\asap\asap.js:27:13)
80 error error rolling back     at process._tickCallback (node.js:419:13)
80 error error rolling back  { [Error: Refusing to delete: C:\Program Files\nodejs\coffeelint.cmd not in C:\Program Files\nodejs]
80 error error rolling back   code: 'EEXIST',
80 error error rolling back   path: 'C:\\Program Files\\nodejs\\coffeelint.cmd' }

Error while install

I get the following error while installing and it just goes into loop
install screen <-> error
01

Number pad detection of version

Ok, so I'm installing 0.10.35 64 but when I click enter in the Console it just outputs:
C:\Users\Mairuzu>nvm install v0.10.35 64
Node.js vv0.10.35 is only available in 32-bit.

but if you hit the numbers in the top row I get:
C:\Users\Mairuzu>nvm install 0.10.35 64
Downloading node.js version 0.10.35 (64-bit)... Complete

This is a bug with the keyboard or my console, or something just weird.

CygWin is an unspecified prerequisite

It might help newbies like me save some time if it is stated that something like CygWin tools are needed in order to run npm, which I discovered is a shell script which cannot be run from cmd.exe as far as I can tell.

Bug on installing iojs ;-)

alex@LIGHTNIGHT ~
$ nvm install iojs
panic: runtime error: index out of range

goroutine 16 [running]:
runtime.panic(0x648460, 0x7c947c)
        C:/Go/src/pkg/runtime/panic.c:279 +0xe9
_/C_/Users/Corey/Documents/workspace/Experiments/nvm/src/nvm/web.IsNode64bitAvailable(0x12520130, 0x4, 0x666180)
        C:/Users/Corey/Documents/workspace/Experiments/nvm/src/nvm/web/web.go:124 +0x1d6
main.install(0x12520130, 0x4, 0x666180, 0x2)
        C:/Users/Corey/Documents/workspace/Experiments/nvm/src/nvm.go:145 +0x279
main.main()
        C:/Users/Corey/Documents/workspace/Experiments/nvm/src/nvm.go:65 +0x599

goroutine 17 [runnable]:
runtime.MHeap_Scavenger()
        C:/Go/src/pkg/runtime/mheap.c:507
runtime.goexit()
        C:/Go/src/pkg/runtime/proc.c:1445

goroutine 18 [runnable]:
bgsweep()
        C:/Go/src/pkg/runtime/mgc0.c:1976
runtime.goexit()
        C:/Go/src/pkg/runtime/proc.c:1445

goroutine 19 [runnable]:
runfinq()
        C:/Go/src/pkg/runtime/mgc0.c:2606
runtime.goexit()
        C:/Go/src/pkg/runtime/proc.c:1445

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.