New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Windows #284

Closed
lmayorga1980 opened this Issue Aug 22, 2013 · 27 comments

Comments

Projects
None yet
@lmayorga1980

No description provided.

@creationix

This comment has been minimized.

Show comment
Hide comment
@creationix

creationix Aug 23, 2013

Owner

Are you using bash on windows? Also there are nvm projects for windows like https://github.com/hakobera/nvmw

Owner

creationix commented Aug 23, 2013

Are you using bash on windows? Also there are nvm projects for windows like https://github.com/hakobera/nvmw

@eirslett

This comment has been minimized.

Show comment
Hide comment
@eirslett

eirslett Oct 6, 2013

Why aren't nvm and nvmw merged into one single project?

eirslett commented Oct 6, 2013

Why aren't nvm and nvmw merged into one single project?

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Oct 6, 2013

Collaborator

Because then anyone wishing to work on nvm would have to test on Windows (a pretty burdensome request), and anyone working on nvmw would have to test on *nix.

Collaborator

ljharb commented Oct 6, 2013

Because then anyone wishing to work on nvm would have to test on Windows (a pretty burdensome request), and anyone working on nvmw would have to test on *nix.

This was referenced Sep 20, 2014

@mcandre

This comment has been minimized.

Show comment
Hide comment
@mcandre

mcandre Sep 20, 2014

@ljharb We can automate these tests with various tools. E.g., Firefox developers don't have to manually test their commits on Windows, Mac, and Linux.

mcandre commented Sep 20, 2014

@ljharb We can automate these tests with various tools. E.g., Firefox developers don't have to manually test their commits on Windows, Mac, and Linux.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Sep 21, 2014

Collaborator

Automated browser and linux testing is a solved problem - I'm not personally familiar with any free/open source solutions for automating non-IE Windows-based testing.

That said, if someone wants to submit a PR that can run automated tests on Windows, that would absolutely clear one of the bigger obstacles to supporting it.

Collaborator

ljharb commented Sep 21, 2014

Automated browser and linux testing is a solved problem - I'm not personally familiar with any free/open source solutions for automating non-IE Windows-based testing.

That said, if someone wants to submit a PR that can run automated tests on Windows, that would absolutely clear one of the bigger obstacles to supporting it.

@coreybutler

This comment has been minimized.

Show comment
Hide comment
@coreybutler

coreybutler Oct 4, 2014

Contributor

For what it's worth, I recently released nvm for windows. It's not a direct port of this project, but it provides the major functionality. It's written in Go, so theoretically it could support OSX/Linux using the same code base if I/someone felt like tweaking it.

Contributor

coreybutler commented Oct 4, 2014

For what it's worth, I recently released nvm for windows. It's not a direct port of this project, but it provides the major functionality. It's written in Go, so theoretically it could support OSX/Linux using the same code base if I/someone felt like tweaking it.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Oct 4, 2014

Collaborator

@coreybutler there's already "nvmw" - please do not name your project "nvm", as that's the name of this project.

Collaborator

ljharb commented Oct 4, 2014

@coreybutler there's already "nvmw" - please do not name your project "nvm", as that's the name of this project.

@coreybutler

This comment has been minimized.

Show comment
Hide comment
@coreybutler

coreybutler Oct 4, 2014

Contributor

@ljharb - I wrote mine as a response to the fact nvmw broke after node 0.10.26, and according to the author's comments in an issue, he doesn't know how to fix it... and I found it easier to write something new than keep contributing to that code base.

If it's really a problem to have the name "nvm for windows", I can change it... but as a Windows AND Mac user that has to switch between Operating Systems regularly, I can say I wish there were a consistent cross-OS command. I can't tell you how many times I typed "nvmw" on Mac or "nvm" on Windows. While minor, the user experience is still annoying. This was a first attempt at easing that annoyance.

@creationix - Thoughts about naming? I'm not trying to step on toes here... nvm was the inspiration for my project... I just needed the functionality on Windows and the other available projects weren't solving the problem.

Contributor

coreybutler commented Oct 4, 2014

@ljharb - I wrote mine as a response to the fact nvmw broke after node 0.10.26, and according to the author's comments in an issue, he doesn't know how to fix it... and I found it easier to write something new than keep contributing to that code base.

If it's really a problem to have the name "nvm for windows", I can change it... but as a Windows AND Mac user that has to switch between Operating Systems regularly, I can say I wish there were a consistent cross-OS command. I can't tell you how many times I typed "nvmw" on Mac or "nvm" on Windows. While minor, the user experience is still annoying. This was a first attempt at easing that annoyance.

@creationix - Thoughts about naming? I'm not trying to step on toes here... nvm was the inspiration for my project... I just needed the functionality on Windows and the other available projects weren't solving the problem.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Oct 4, 2014

Collaborator

Ah, I wasn't aware nvmw was broken. Even if it wasn't, it's of course always fine to develop an alternative to a tool :-)

Note, I'm not suggesting you shouldn't use an executable named "nvm" for consistency - I'm suggesting that the actual name of the repo/project shouldn't just be "nvm".

Collaborator

ljharb commented Oct 4, 2014

Ah, I wasn't aware nvmw was broken. Even if it wasn't, it's of course always fine to develop an alternative to a tool :-)

Note, I'm not suggesting you shouldn't use an executable named "nvm" for consistency - I'm suggesting that the actual name of the repo/project shouldn't just be "nvm".

@coreybutler

This comment has been minimized.

Show comment
Hide comment
@coreybutler

coreybutler Oct 4, 2014

Contributor

@ljharb - fair enough - I renamed the repo to nvm-windows to show some separation.

Contributor

coreybutler commented Oct 4, 2014

@ljharb - fair enough - I renamed the repo to nvm-windows to show some separation.

ljharb added a commit to ljharb/nvm that referenced this issue Oct 4, 2014

ljharb added a commit to ljharb/nvm that referenced this issue Oct 4, 2014

ljharb added a commit to ljharb/nvm that referenced this issue Oct 4, 2014

ljharb added a commit to ljharb/nvm that referenced this issue Oct 4, 2014

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Oct 4, 2014

Collaborator

Thanks! I added a note to the README about Windows options.

Collaborator

ljharb commented Oct 4, 2014

Thanks! I added a note to the README about Windows options.

@coreybutler

This comment has been minimized.

Show comment
Hide comment
@coreybutler

coreybutler Oct 5, 2014

Contributor

Thanks!

Contributor

coreybutler commented Oct 5, 2014

Thanks!

@nschonni

This comment has been minimized.

Show comment
Hide comment
@nschonni

nschonni Oct 8, 2014

You might want to check out http://www.appveyor.com/ for testing the builds on Windows.

nschonni commented Oct 8, 2014

You might want to check out http://www.appveyor.com/ for testing the builds on Windows.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Dec 17, 2014

Collaborator

Closing this now, since the Windows options are noted in the README.

Collaborator

ljharb commented Dec 17, 2014

Closing this now, since the Windows options are noted in the README.

@ljharb ljharb closed this Dec 17, 2014

@tugberkugurlu

This comment has been minimized.

Show comment
Hide comment
@tugberkugurlu

tugberkugurlu Apr 25, 2015

👍 for @nschonni suggestion.

👍 for @nschonni suggestion.

@winniehell

This comment has been minimized.

Show comment
Hide comment
@winniehell

winniehell May 1, 2015

Are there any issues with running nvm (for non-Windows) with Cygwin on Windows? I don't see why development has to be done (at least) twice if there is an option get down to the root of all evil.

Are there any issues with running nvm (for non-Windows) with Cygwin on Windows? I don't see why development has to be done (at least) twice if there is an option get down to the root of all evil.

@mcandre

This comment has been minimized.

Show comment
Hide comment
@mcandre

mcandre May 1, 2015

@winniehell Cygwin / MSYS / Git Bash are fantastic, but there are situations where you want to be able to use a tool in an ordinary cmd.exe Command Prompt or PowerShell session.

For example, you might have some MS-DOS batch .bat scripts that you want to chain together with a Node.js tool, maybe even with a Makefile to coordinate the chain. It's easy for these to conflict, as Cygwin can't run .bat files (open feature request), and Command Prompt can't run nvm.

mcandre commented May 1, 2015

@winniehell Cygwin / MSYS / Git Bash are fantastic, but there are situations where you want to be able to use a tool in an ordinary cmd.exe Command Prompt or PowerShell session.

For example, you might have some MS-DOS batch .bat scripts that you want to chain together with a Node.js tool, maybe even with a Makefile to coordinate the chain. It's easy for these to conflict, as Cygwin can't run .bat files (open feature request), and Command Prompt can't run nvm.

@rainabba

This comment has been minimized.

Show comment
Hide comment
@rainabba

rainabba Aug 16, 2015

Why not just support Windows as should be the case since Node.js as a project sees Windows as a first-class citizen? The split projects creates additional issues.

Why not just support Windows as should be the case since Node.js as a project sees Windows as a first-class citizen? The split projects creates additional issues.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Aug 16, 2015

Collaborator

node and npm consider Windows a first-class citizen. That's not necessarily the case with unaffiliated project authors.

In general terms, I don't typically support Windows because the burden of running both manual and automated tests on it is massive. Specific to nvm, it's problematic enough supporting POSIX without having to support an alternative shell paradigm - we don't support fish either for a similar reason.

Collaborator

ljharb commented Aug 16, 2015

node and npm consider Windows a first-class citizen. That's not necessarily the case with unaffiliated project authors.

In general terms, I don't typically support Windows because the burden of running both manual and automated tests on it is massive. Specific to nvm, it's problematic enough supporting POSIX without having to support an alternative shell paradigm - we don't support fish either for a similar reason.

@GitTom

This comment has been minimized.

Show comment
Hide comment
@GitTom

GitTom Apr 23, 2016

It sounds like MS's new Windows Subsystem for Linux (WSL) might make it easier for lots of nix command-line projects to support Windows 10:
https://blogs.msdn.microsoft.com/commandline/2016/04/06/bash-on-ubuntu-on-windows-download-now-3/

I know this isn't a perfect solution for nvm on Windows but probably an easy one.

GitTom commented Apr 23, 2016

It sounds like MS's new Windows Subsystem for Linux (WSL) might make it easier for lots of nix command-line projects to support Windows 10:
https://blogs.msdn.microsoft.com/commandline/2016/04/06/bash-on-ubuntu-on-windows-download-now-3/

I know this isn't a perfect solution for nvm on Windows but probably an easy one.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Apr 23, 2016

Collaborator

@GitTom once Windows Bash supports the right POSIX syscalls, nvm will work with it. It doesn't quite yet.

Collaborator

ljharb commented Apr 23, 2016

@GitTom once Windows Bash supports the right POSIX syscalls, nvm will work with it. It doesn't quite yet.

@Joris-van-der-Wel

This comment has been minimized.

Show comment
Hide comment
@Joris-van-der-Wel

Joris-van-der-Wel Aug 21, 2016

I just used nvm successfully using "bash on ubuntu on windows". The install script had some quirks though, the download "failed" until I executed sudo apt-get install git, even though curl was installed:

joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9135  100  9135    0     0  53946      0 --:--:-- --:--:-- --:--:-- 54053
=> Downloading nvm as script to '/home/joris/.nvm'
Failed to download 'https://raw.githubusercontent.com/creationix/nvm/v0.31.4/nvm-exec'

=> Appending source string to /home/joris/.bashrc
bash: line 293: /nvm.sh: No such file or directory
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="/home/joris/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvmjoris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ sudo apt-get install git curl wget
# ...snip...

joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9135  100  9135    0     0   126k      0 --:--:-- --:--:-- --:--:--  125k
=> Downloading nvm from git to '/home/joris/.nvm'
=> fatal: destination path '/home/joris/.nvm' already exists and is not an empty directory.
Failed to clone nvm repo. Please report this!
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ rm -rf /home/joris/.nvm
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9135  100  9135    0     0   167k      0 --:--:-- --:--:-- --:--:--  168k
=> Downloading nvm from git to '/home/joris/.nvm'
=> Cloning into '/home/joris/.nvm'...
remote: Counting objects: 5222, done.
remote: Total 5222 (delta 0), reused 0 (delta 0), pack-reused 5222
Receiving objects: 100% (5222/5222), 1.42 MiB | 966.00 KiB/s, done.
Resolving deltas: 100% (3148/3148), done.
Checking connectivity... done.
* (detached from v0.31.4)
  master

=> Source string already in /home/joris/.bashrc
bash: line 293: /nvm.sh: No such file or directory
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="/home/joris/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvmjoris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ exit
exit

D:\Users\J\Projects\jsdom>bash
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ echo $NVM_DIR
/home/joris/.nvm
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ nvm i node
Downloading https://nodejs.org/dist/v6.4.0/node-v6.4.0-linux-x64.tar.xz...
######################################################################## 100.0%
Now using node v6.4.0 (npm v3.10.3)
Creating default alias: default -> node (-> v6.4.0)
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ node --version
v6.4.0
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ npm --version
3.10.3

Joris-van-der-Wel commented Aug 21, 2016

I just used nvm successfully using "bash on ubuntu on windows". The install script had some quirks though, the download "failed" until I executed sudo apt-get install git, even though curl was installed:

joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9135  100  9135    0     0  53946      0 --:--:-- --:--:-- --:--:-- 54053
=> Downloading nvm as script to '/home/joris/.nvm'
Failed to download 'https://raw.githubusercontent.com/creationix/nvm/v0.31.4/nvm-exec'

=> Appending source string to /home/joris/.bashrc
bash: line 293: /nvm.sh: No such file or directory
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="/home/joris/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvmjoris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ sudo apt-get install git curl wget
# ...snip...

joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9135  100  9135    0     0   126k      0 --:--:-- --:--:-- --:--:--  125k
=> Downloading nvm from git to '/home/joris/.nvm'
=> fatal: destination path '/home/joris/.nvm' already exists and is not an empty directory.
Failed to clone nvm repo. Please report this!
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ rm -rf /home/joris/.nvm
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9135  100  9135    0     0   167k      0 --:--:-- --:--:-- --:--:--  168k
=> Downloading nvm from git to '/home/joris/.nvm'
=> Cloning into '/home/joris/.nvm'...
remote: Counting objects: 5222, done.
remote: Total 5222 (delta 0), reused 0 (delta 0), pack-reused 5222
Receiving objects: 100% (5222/5222), 1.42 MiB | 966.00 KiB/s, done.
Resolving deltas: 100% (3148/3148), done.
Checking connectivity... done.
* (detached from v0.31.4)
  master

=> Source string already in /home/joris/.bashrc
bash: line 293: /nvm.sh: No such file or directory
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="/home/joris/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvmjoris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ exit
exit

D:\Users\J\Projects\jsdom>bash
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ echo $NVM_DIR
/home/joris/.nvm
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ nvm i node
Downloading https://nodejs.org/dist/v6.4.0/node-v6.4.0-linux-x64.tar.xz...
######################################################################## 100.0%
Now using node v6.4.0 (npm v3.10.3)
Creating default alias: default -> node (-> v6.4.0)
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ node --version
v6.4.0
joris@FOOBAR:/mnt/d/Users/J/Projects/jsdom$ npm --version
3.10.3
@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Aug 21, 2016

Collaborator

Thanks for testing that out!

Collaborator

ljharb commented Aug 21, 2016

Thanks for testing that out!

@ibqn

This comment has been minimized.

Show comment
Hide comment
@ibqn

ibqn Dec 28, 2016

Does NVM work in git bash on Windows out of the box? Can someone confirm this?

ibqn commented Dec 28, 2016

Does NVM work in git bash on Windows out of the box? Can someone confirm this?

@Joris-van-der-Wel

This comment has been minimized.

Show comment
Hide comment
@Joris-van-der-Wel

Joris-van-der-Wel Dec 28, 2016

Does NVM work in git bash on Windows out of the box? Can someone confirm this?

The last time I tried, it works properly if you execute the following:

sudo apt-get install git curl wget
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash

Does NVM work in git bash on Windows out of the box? Can someone confirm this?

The last time I tried, it works properly if you execute the following:

sudo apt-get install git curl wget
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
@rainabba

This comment has been minimized.

Show comment
Hide comment
@rainabba

rainabba Dec 28, 2016

Perhaps this issue should be renamed, "Support for Windows CMD/PowerShell" now since at best, WSL will work and at worse, it will present its own set of issues.

Perhaps this issue should be renamed, "Support for Windows CMD/PowerShell" now since at best, WSL will work and at worse, it will present its own set of issues.

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Dec 28, 2016

Collaborator
  • BashOnWindows / Windows Subsystem for Linux should work out of the box - if it does not, it's a bug in that software.
  • git bash seems to work as long as sudo apt-get install git curl wget is run beforehand.
  • No other windows support from nvm is forthcoming, unless #1203 / nodejs/TSC#96 is resolved such that nvm enters the node.js foundation.
Collaborator

ljharb commented Dec 28, 2016

  • BashOnWindows / Windows Subsystem for Linux should work out of the box - if it does not, it's a bug in that software.
  • git bash seems to work as long as sudo apt-get install git curl wget is run beforehand.
  • No other windows support from nvm is forthcoming, unless #1203 / nodejs/TSC#96 is resolved such that nvm enters the node.js foundation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment