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

yarn add grpc throws error [0.17.0] #1817

Closed
rajatkumar opened this issue Nov 14, 2016 · 13 comments
Closed

yarn add grpc throws error [0.17.0] #1817

rajatkumar opened this issue Nov 14, 2016 · 13 comments
Labels

Comments

@rajatkumar
Copy link

I get the following error:

$ yarn add grpc
yarn add v0.17.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/4] ⠄ dtrace-provider
[2/4] ⠄ dtrace-provider
[3/4] ⠄ grpc
[4/4] ⠄ grpc
error /apps/node_modules/grpc: Command failed.
Exit code: 127
Command: sh

Arguments: -c ./node_modules/.bin/node-pre-gyp install --fallback-to-build
Directory: /apps/node_modules/grpc
Output:
sh: ./node_modules/.bin/node-pre-gyp: No such file or directory

Surprisingly this works with npm install

node --version
v4.6.1
npm --version
2.15.9
yarn --version
0.17.0
OS:
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

@rajatkumar rajatkumar changed the title yarn add does not work for grpc yarn add grpc throws error [0.17.0] Nov 14, 2016
@jscinoz
Copy link

jscinoz commented Nov 15, 2016

Oddly enough, if you run yarn add grpc again, it works from then on.

Removing ~/.cache/yarn will cause the issue to occur again the next time you try to run yarn add grpc.

I suspect yarn might not be properly handling bundledDependencies on the first-run, as grpc includes node-pre-gyp by way of bundledDepdencies.

@jscinoz
Copy link

jscinoz commented Nov 15, 2016

Actually, turns out grpc isn't properly installed even after the second run. Yarn thinks it is and completes successfully but the native module that failed to build due to the error in the original post isn't present.

@rajatkumar
Copy link
Author

Exactly, yarn also needs a mechanism to identify if a module was successfully installed.

@Zhomart
Copy link

Zhomart commented Nov 17, 2016

I've installed latest yarn using $ npm install --silent -g yarn@0.17.3 and force installed packages $ yarn install --force. It worked for me.

@wyze wyze added cat-bug and removed needs triage labels Nov 17, 2016
@bestander
Copy link
Member

Can't reproduce this on latest either

@bestander
Copy link
Member

Yeah, I can confirm that this was broken in 0.17.0 but works in 0.17.3

@lostpebble
Copy link

Still getting this error:

D:\Dev\_Projects\Vibescout\vibescout-web-v3>yarn install --force
yarn install v0.17.9
info No lockfile found.
[1/4] Resolving packages...
warning googleapis > google-auth-library > request > node-uuid@1.4.7: use uuid module instead
[2/4] Fetching packages...
warning fsevents@1.0.15: The platform "win32" is incompatible with this module.
info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Unmet peer dependency "babel-core@^6.0.0".
warning Incorrect peer dependency "webpack@2.1.x".
warning Unmet peer dependency "history@^2.0.0 || ^3.0.0".
[4/4] Rebuilding all packages...
[1/7] ? fsevents
[2/7] ? grpc: operable program or batch file.
[3/7] ? gifsicle
[4/7] ? mozjpeg
error D:\Dev\_Projects\Vibescout\vibescout-web-v3\node_modules\grpc: Command failed.
Exit code: 1
Command: C:\Windows\system32\cmd.exe
Arguments: /d /s /c ./node_modules/.bin/node-pre-gyp install --fallback-to-build
Directory: D:\Dev\_Projects\Vibescout\vibescout-web-v3\node_modules\grpc
Output:
'.' is not recognized as an internal or external command,
operable program or batch file.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

This is also after I removed /node_modules completely and tried a fresh install with yarn install --force

If I run npm rebuild afterwards, then GRPC installs properly.

@bestander
Copy link
Member

@lostpebble, does yarn cache clean help?

@lostpebble
Copy link

I tried deleting node_modules, ran yarn cache clean and then yarn, but it failed in exactly the same way.

Then on top of that, I tried yarn cache clean, and running yarn install --force, and I got a completely different error this time:

D:\Dev\_Projects\Vibescout\vibescout-web-v3>yarn install --force
yarn install v0.17.9
info No lockfile found.
[1/4] Resolving packages...
warning googleapis > google-auth-library > request > node-uuid@1.4.7: use uuid module instead
[2/4] Fetching packages...
warning fsevents@1.0.15: The platform "win32" is incompatible with this module.
info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning Unmet peer dependency "babel-core@^6.0.0".
warning Incorrect peer dependency "webpack@2.1.x".
warning Unmet peer dependency "history@^2.0.0 || ^3.0.0".
error An unexpected error occurred: "ENOENT: no such file or directory, open 'D:\\Dev\\_Projects\\Vibescout\\vibescout-web-v3\\node_modules\\@google-cloud\\common\\node_modules\\dot-prop\\index.js'".
info If you think this is a bug, please open a bug report with the information provided in "D:\\Dev\\_Projects\\Vibescout\\vibescout-web-v3\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@bestander
Copy link
Member

@Google-Cloud - could it be related to scoped packages issue?
We solved it in master but haven't cherry-picked it in 0.17.
@lostpebble, can you try on master branch build https://ci.appveyor.com/project/kittens/yarn/build/1055/job/jwqih112xeknrm87/artifacts?

@lostpebble
Copy link

lostpebble commented Jan 20, 2017

I had a lot of time sensitive work to do so I moved back to NPM for a while on my project to get that done. But I really want to use yarn, and I'm now using version 0.19.1 (installed with the lastest .msi) and I'm still getting the same error, trying out the same things.

This is the script that is specifically causing the problem I think (the install script for the grpc package):

"install": "node-pre-gyp install --fallback-to-build",

Still causing this error on Windows environment:

[4/4] Building fresh packages...
[1/6] ? grpc
[2/6] ? gifsicle
[3/6] ? mozjpeg
[4/6] ? optipng-bin
error D:\Dev\_Projects\Vibescout\vibescout-web-v3-yarn\node_modules\grpc: Command failed.
Exit code: 1
Command: C:\Windows\system32\cmd.exe
Arguments: /d /s /c ./node_modules/.bin/node-pre-gyp install --fallback-to-build
Directory: D:\Dev\_Projects\Vibescout\vibescout-web-v3-yarn\node_modules\grpc
Output:
'.' is not recognized as an internal or external command,
operable program or batch file.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

But using npm rebuild works fine, has no problem running the install scripts successfully, with the output:

D:\Dev\_Projects\Vibescout\vibescout-web-v3-yarn>npm rebuild

> grpc@1.0.1 install D:\Dev\_Projects\Vibescout\vibescout-web-v3-yarn\node_modules\grpc
> node-pre-gyp install --fallback-to-build

[grpc] Success: "D:\Dev\_Projects\Vibescout\vibescout-web-v3-yarn\node_modules\grpc\src\node\extension_binary\grpc_node.node" is installed via remote

EDIT:

I get the feeling this may be associated with this problem with relative paths on Windows: #1729

@bestander
Copy link
Member

Yeah, I can reproduce this on Windows.
I'll try to have a look now

@bestander
Copy link
Member

Let's track the '.' is not recognized as an internal or external command, issue in #1729

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

No branches or pull requests

6 participants