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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nodejs_host//:yarn no such target #3530

Closed
dgnemo opened this issue Aug 12, 2022 · 1 comment 路 Fixed by #3597
Closed

@nodejs_host//:yarn no such target #3530

dgnemo opened this issue Aug 12, 2022 · 1 comment 路 Fixed by #3597

Comments

@dgnemo
Copy link

dgnemo commented Aug 12, 2022

馃悶 bug report

In multiple place in the code and in the documentation it's mentioned to execute
bazel run @nodejs_host//:yarn install to update a dependency or install a new one

vendored yarn binary. `bazel run @nodejs_host//:yarn install`. You can pass the options like

but the command bazel run @nodejs_host//:yarn install does not work (target does not exist),
even on a repo created following the quickstart directions.

馃敩 Minimal Reproduction

$ npx @bazel/create workspace --packageManager=yarn
Creating Bazel workspace workspace...
Successfully created new Bazel workspace at /home/diego/js-bazel-test/workspace
Next steps:
  1. cd workspace
  2. yarn install
  3. yarn build
     Note that there is nothing to build, so this trivially succeeds.
  4. Add contents to the BUILD.bazel file or create a new BUILD.bazel in a subdirectory.

$ cd workspace
$ bazel run @nodejs_host//:yarn
INFO: Invocation ID: 714bcd52-86e6-41d8-bf43-3487a91f6d99
ERROR: Skipping '@nodejs_host//:yarn': no such target '@nodejs_host//:yarn': target 'yarn' not declared in package '' defined by /home/--/.cache/bazel/_bazel_--/6ab1a205e0a75010d0a8dd8cfcbcb536/external/nodejs_host/BUILD.bazel
WARNING: Target pattern parsing failed.
ERROR: no such target '@nodejs_host//:yarn': target 'yarn' not declared in package '' defined by /home/--/.cache/bazel/_bazel_--/6ab1a205e0a75010d0a8dd8cfcbcb536/external/nodejs_host/BUILD.bazel
INFO: Elapsed time: 0.473s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

$ bazel query @nodejs_host//...
@nodejs_host//:node
@nodejs_host//:node_bin
@nodejs_host//:node_files
@nodejs_host//:npm
@nodejs_host//:npm_bin
@nodejs_host//:npm_files
@nodejs_host//:npx_bin
@nodejs_host//:run_npm.bat.template
@nodejs_host//:run_npm.sh.template
Loading: 0 packages loaded

馃敟 Exception or Error

'@nodejs_host//:yarn': no such target '@nodejs_host//:yarn': target 'yarn' not declared in package ''
defined by /home/--/.cache/bazel/_bazel_--/6ab1a205e0a75010d0a8dd8cfcbcb536/external/nodejs_host/BUILD.bazel

馃實 Your Environment

Operating System: Linux

Output of bazel version:

$ bazel version
Bazelisk version: development
Build label: 5.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Jan 19 14:08:54 2022 (1642601334)
Build timestamp: 1642601334
Build timestamp as int: 1642601334

Rules_nodejs version: 5.5.3

@alexeagle
Copy link
Collaborator

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

Successfully merging a pull request may close this issue.

2 participants