Skip to content
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

Installation Problem: Both install methods for Windows are broken #626

Closed
TheJaredWilcurt opened this issue Oct 11, 2016 · 10 comments
Closed

Comments

@TheJaredWilcurt
Copy link

Which operating system are you using:

Win 7 Pro 64

Please describe the steps you took when trying to install Yarn and what went wrong:

error


If you are requiring that I have Node installed.... and Node comes with NPM.... why can't I just do npm install -g yarn. Which would actually work. Unlike your other installation methods which are broken.

I use nvm-windows, so my node installation isn't in the same location as the default install. But that doesn't matter, all you have to do is run node -v and check to see what returns from my global PATH, as that's all that matters.

@zbuttram
Copy link

Not a fix, but you can do npm i -g yarnpkg if you have npm.

@TheJaredWilcurt
Copy link
Author

So after posting this I saw there is an "Alternatives" section for installs. There is an npm install -g yarnpkg option there. Why it's there is a whole nother problem. This should be listed prominently on the Windows tab, as it is the preferred install method for almost all front-end devs.

But that doesn't matter anyways, because it doesn't work either:

error

@Daniel15
Copy link
Member

Daniel15 commented Oct 11, 2016

The Chocolatey package is still awaiting approval by the Chocolatey team, installing via Chocolatey won't work until it's approved.

@TheJaredWilcurt - The installer checks for Node.js by looking for HKEY_LOCAL_MACHINE\SOFTWARE\Node.js in the registry. Did you install Node.js via the installer? Do you have the 32-bit or 64-bit version of Node.js installed? It may not be looking in the right place if you're running 32-bit Node.js on 64-bit Windows.

This should be listed prominently on the Windows tab, as it is the preferred install method for almost all front-end devs.

The npm package is a fallback; it's not supposed to be the primary means of installing Yarn. The Windows installer is what we recommend on Windows.

Are you on npm v2 or npm v3 (run npm --version to check)? v2 sometimes has trouble on Windows. You can run npm install npm --global to upgrade npm itself.

@superherointj
Copy link

In Windows it is fairly common to use 'nodist' to keep node.js updated and be able to switch between Node.JS versions. Here the Yarn install also failed for same reason. Couldn't locate Node.JS, but I have Node.JS installed version 6.7.0. BUT again, it was installed by nodist [ https://github.com/marcelklehr/nodist ]

@coreybutler
Copy link

@Daniel15 - Just a heads up: you may get alot of issues from users of nvm for windows, specifically if there are problems with 32 vs 64 bit yarn installations.

In an effort to reduce the massive footprint multiple node installations can have on Windows (especially with older versions of node module dependency trees), NVM4W dynamically swaps the bitness through a simple file rename. For example, running nvm install 6.0.0 will produce a directory structure like:

/nvm-install-root
  - 6.0.0
    - node_modules
    - node.exe

By default, NVM4W will download the appropriate bitness based on either the user-defined preference or the native bitness of the operating system. So, a 32-bit version of Windows will download a 32-bit version of node.

Things get more complicated on 64-bit systems because the user has a choice. By default, the 64-bit version of node would be installed... but users can also install the 32-bit version (nvm install 6.0.0 32 and hot-swap the versions via nvm use 32 or nvm use 64.

This is accomplished by renaming the executable file on the fly. It's not the best approach, but it was the only thing I had time to do that would work on older versions of Windows. In other words, if the user adds a 32-bit version of node in addition to the 64-bit, the file structure will look like:

/nvm-install-root
  - 6.0.0
    - node_modules
    - node.exe
    - node32.exe 

In this state, the 64-bit version is active. If the user issues nvm use 6.0.0 32, it will change the file structure to:

/nvm-install-root
  - 6.0.0
    - node_modules
    - node64.exe
    - node.exe 

So, the potential problem here is the node_modules directory is the same for both 32-bit and 64-bit versions.

Just thought you should know.

@Daniel15
Copy link
Member

Good catch, I didn't realise people used nvm or nodist. I guess these apps don't correctly update the registry to signify that Node.js is installed.

Sounds like I should just remove the Node version check for now. People that don't have Node.js will get an error when they try to run Yarn, but I guess that's better than not being able to install it even though you do have a version of Node.js.

I'll remove it and post an updated MSI.

Daniel15 added a commit to Daniel15/yarn that referenced this issue Oct 11, 2016
It doesn't handle systems such as nvm or nodemon that install Node.js without updating the registry.

References yarnpkg#626
Daniel15 added a commit that referenced this issue Oct 11, 2016
It doesn't handle systems such as nvm or nodemon that install Node.js without updating the registry.

References #626
@Daniel15
Copy link
Member

I uploaded a new Yarn MSI file that does not perform the Node.js version check. You should be able to install and use it as long as node.exe 4.0 or above is somewhere on your path. You can download it again from https://yarnpkg.com/latest.msi

Thanks for reporting this!

Daniel15 added a commit that referenced this issue Oct 11, 2016
It doesn't handle systems such as nvm or nodemon that install Node.js without updating the registry.

References #626
@coreybutler
Copy link

@Daniel15 - Actually, there is no "official" way to identify a node installation, so there is no "correct" way to signify an installation. Using the registry key as the determining factor of whether node is installed is not reliable. The community needs reliable standards so projects like yarn/version managers/etc can interoperate. This problem also occurs in Linux/macOS environments as well, which is why tools like nvm (for *nix) have problems when users cherry-pick a version of node to run (node in a shell wrapper).

For the last few years, I've been pushing the TSC to set some sort of standard. I strongly encourage you to get involved in some of the TSC discussions around the subject of standards, specifically around installations. The more noise we can create, the more likely the TSC is to address the issue. Now happens to be a very good time to get involved... because there has been discussion of adopting both nvm projects into the Node foundation.

@Daniel15
Copy link
Member

I strongly encourage you to get involved in some of the TSC discussions around the subject of standards, specifically around installations.

@coreybutler What is the TSC? Sorry, I'm not very familiar with the Node.js ecosystem, and Google search for TSC just returned me stuff about TypeScript 😛

@coreybutler
Copy link

@Daniel15 - TSC = Technical Steering Committee. It's the consortium that determines the roadmap for Node. They keep their discussions in the TSC repo. Most of the actual discussions happen in the issues. Let me know if there's anything I can do to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants