Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Yarn install fails (no binaries), npm install succeeds. #154

Open
cleidigh opened this issue Oct 25, 2018 · 16 comments
Open

Yarn install fails (no binaries), npm install succeeds. #154

cleidigh opened this issue Oct 25, 2018 · 16 comments

Comments

@cleidigh
Copy link

cleidigh commented Oct 25, 2018

@cleidigh here from the Visual Studio Code project.

We recommend using windows-build-tools for development environments
covering the Python and Microsoft build tools requirements.
Just recently I had an issue on a new machine that required
the 2015 tools. I ran into a problem installing early on in the process.
I have the Visual Studio Community 2017 and the command tools installed.
My OS is Windows 10. in thinking there may be a conflict installing both,
but I would think that the same issue would be within npm.

All the following yarn installs failed - package has no binaries

yarn global add windows-build-tools --vs2015
yarn global add windows-build-tools
yarn global add [email protected] --vs2015

I was successful with npm

npm install --global windows-build-tools --vs2015

I have a fairly new Windows 10 machine with not a lot of cruft.
I looked at the issues the windows-build-tools and found nothing relevant.
I'm a bit baffled, I can't imagine both these are broken , but also cannot understand
what on my system produce the error of the missing binaries.

PS C:\Windows\system32> yarn global add windows-build-tools --vs2015
yarn global v1.10.1
[1/4] Resolving packages...
warning windows-build-tools > nugget > progress-stream > through2 > xtend > [email protected]:
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
warning "[email protected]" has no binaries
Done in 4.37s.

PS C:\Windows\system32> yarn global add windows-build-tools
yarn global v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
warning "[email protected]" has no binaries
Done in 3.38s.
PS C:\Windows\system32> yarn global add windows-build-tools --vs2015^C
PS C:\Windows\system32>
PS C:\Windows\system32> npm install --global windows-build-tools
>> ^C
PS C:\Windows\system32> npm install --global windows-build-tools --vs2015

> [email protected] postinstall C:\Users\Christopher\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js

Downloading BuildTools_Full.exe
[============================================>] 100.0% of 3.29 MB (2.63 MB/s)
Downloaded BuildTools_Full.exe. Saved to C:\Users\Christopher\.windows-build-tools\BuildTools_Full.exe.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Python 2.7.15 :: Anaconda Inc. is already installed, not installing again.

Now configuring the Visual Studio Build Tools..

All done!

+ [email protected]
added 143 packages from 96 contributors in 288.348s
PS C:\Windows\system32>
```switched insiders
@afilp
Copy link

afilp commented Nov 6, 2018

I have the same problem, can you please help? Thanks!

@jacobq
Copy link
Collaborator

jacobq commented Nov 6, 2018

I don't think the "has no binaries" message is an error. That is a warning message because most packages that one would install globally have executable (binary) files to go in .bin. yarn helpfully displays a warning when none are found, but for windows-build-tools external things are being installed. e.g. you wouldn't subsequently run ./windows-build-tools to do something.

So other than that message, how does yarn global add windows-build-tools fail?

@afilp
Copy link

afilp commented Nov 6, 2018

Actually, my problem is that yarn fails (when just running yarn inside the project) because of node-gyp (Windows 10, using windows-build-tools, running as Admin):

image

@jacobq
Copy link
Collaborator

jacobq commented Nov 6, 2018

@afilp This may be a dumb questions, but do you have node-gyp installed? If you could provide a complete text log (perhaps using <summary> & <details>) that would be much more helpful than a screenshot.

@cleidigh
Copy link
Author

cleidigh commented Nov 6, 2018

@jacobq
my initial posting has a log dump. Even if the binaries warning it's just that, you can see the install still fails after. Any thoughts on that scenario?

@jacobq
Copy link
Collaborator

jacobq commented Nov 6, 2018

@cleidigh I didn't see any explicit failure indications in the logs you shared except that the usual output did not appear. Is that what you are referring to? Perhaps yarn is not running the postinstall script (yarnpkg/yarn#853)?

@felixrieseberg do you think this is something that we should attempt to "fix" (e.g. use an alternative to that hook) or just document as known behavior (i.e. that yarn doesn't run that hook automatically)? (Currently README.md lists installation via yarn as a viable option.)

@afilp
Copy link

afilp commented Nov 7, 2018

@jacobq I am in Windows, using nvm. I thought windows-build-tools takes care of installing node-gyp, not? If not, what should I do to install it? Thank you very much for any clarifications!

@jacobq
Copy link
Collaborator

jacobq commented Nov 7, 2018

@afilp I don't see anything in the code that would install node-gyp, and I think there is usually a version of it included with node. However, I know that in my CI scripts I have sometimes needed to install/upgrade it manually to prevent problems. You can try manually installing via npm install -g node-gyp. If that fixes your problem please let us know. I noticed that there isn't any mention of it in the README.md other than the claim to be a 'one-liner', so we may need to look into this and fix it / update documentation.

@afilp
Copy link

afilp commented Nov 7, 2018

@jacobq You are right, installing node-gyp is a separate step. I did as per instrutions on your provided link. I still get a fail when using yarn.

Could it be nvm (for windows) the reason?

I looked there and found these (after the installations):

image

This sound good to me (or not?).

@afilp
Copy link

afilp commented Nov 7, 2018

I also installed yarn inside the nvm\v10.6.0.

Could it be that it is running from another folder instead?

This is what I got with where:

$ where yarn
C:\Program Files\nodejs\yarn
C:\Program Files\nodejs\yarn.cmd
C:\Program Files (x86)\Yarn\bin\yarn
C:\Program Files (x86)\Yarn\bin\yarn.cmd
C:\Program Files (x86)\Yarn\bin\yarn.js
C:\Users\afil\AppData\Roaming\npm\yarn
C:\Users\afil\AppData\Roaming\npm\yarn.cmd

@jacobq
Copy link
Collaborator

jacobq commented Nov 7, 2018

@afilp IIRC, the windows version of nvm uses a symbolic link (e.g. C:\Program Files\nodejs is a "shortcut" to another folder containing the specific version that you're using), so that all looks fine (though I recommend installing yarn separately on Windows, not through NPM -- there could be a problem if it doesn't know which node version to use). Like the OP, does it work right when you use npm but not when you use yarn or is neither one working for you?

@flemwad
Copy link

flemwad commented Nov 7, 2018

I also happen to be using yarn, nvm, and am on a windows machine. I'm also seeing the "no binaries" message @ version 5.0.0.

Before I tried installing with yarn I tried using npm. It did start installing but then seemingly hung and not did not complete, with a message at the bottom "Successfully installed Python 2.7." This seems to be another issue (#116)

I thought it hadn't finished installing, so I tried using yarn and witnessed the aforementioned issue:
image

@afilp
Copy link

afilp commented Nov 8, 2018

@jacobq When I use npm i I get the following error:

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.

Note that I read somewhere that [email protected] cannot work with nodejs v10, which is the one that I am using. Could it be this the reason? Then, how do I install a newer one?

UPDATE: I also see that there are problems with grpc and firebase. I am using it. I will investigate further here:
grpc/grpc-node#121

@afilp
Copy link

afilp commented Nov 8, 2018

UPDATE: Indeed, the problem was with firebase and grpc. I solved it now by upgrading the firebase. Thank you and sorry for the trouble.

Note 1: Windows Defender should also be OFF.
Note 2: Running yarn in a terminal as admin may also be needed.

@xiaodeaux
Copy link

I think I'm having a problem with this as well.

PS > yarn global add windows-build-tools@latest

yarn global v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@vue/cli > @vue/cli-ui > [email protected]" has unmet peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".
warning "@vue/cli > @vue/cli-ui > [email protected]" has unmet peer dependency "graphql@>=0.8.0".
[4/4] Building fresh packages...
warning "[email protected]" has no binaries
Done in 20.44s.

PS > yarn global list

yarn global v1.12.3
info "@angular/[email protected]" has binaries:
   - ng
info "@vue/[email protected]" has binaries:
   - vue
info "[email protected]" has binaries:
   - create-react-app
info "[email protected]" has binaries:
   - jshint
info "[email protected]" has binaries:
   - node-gyp
info "[email protected]" has binaries:
   - npm
   - npx
info "[email protected]" has binaries:
   - npm-check
info "[email protected]" has binaries:
   - npm-windows-upgrade
info "[email protected]" has binaries:
   - npx
info "[email protected]" has binaries:
   - ts-node
info "[email protected]" has binaries:
   - tslint
info "[email protected]" has binaries:
   - tsc
   - tsserver
Done in 1.56s.

When I check yarn to see what global packages are installed I don't see windows-build-tools listed. But npm does list it as a globally installed package.

I'm on Windows 10 and my versions are

PS > nvm -v
Running version 1.1.7
PS > node -v
v10.11.0
PS > yarn -v
1.12.3
PS > npm -v
6.5.0

@JeneeshKV
Copy link

seems like yarn is not installed globally. Please try ./ just before the yarn command (.\yarn) then it works.

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

No branches or pull requests

6 participants