{"action":"opened","issue":{"url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/416","repository_url":"https://api.github.com/repos/bazelbuild/rules_nodejs","labels_url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/416/labels{/name}","comments_url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/416/comments","events_url":"https://api.github.com/repos/bazelbuild/rules_nodejs/issues/416/events","html_url":"https://github.com/bazelbuild/rules_nodejs/issues/416","id":380755288,"node_id":"MDU6SXNzdWUzODA3NTUyODg=","number":416,"title":"Error with npm_install but not with yarn_install","user":{"login":"Dig-Doug","id":9574750,"node_id":"MDQ6VXNlcjk1NzQ3NTA=","avatar_url":"https://avatars0.githubusercontent.com/u/9574750?v=4","gravatar_id":"","url":"https://api.github.com/users/Dig-Doug","html_url":"https://github.com/Dig-Doug","followers_url":"https://api.github.com/users/Dig-Doug/followers","following_url":"https://api.github.com/users/Dig-Doug/following{/other_user}","gists_url":"https://api.github.com/users/Dig-Doug/gists{/gist_id}","starred_url":"https://api.github.com/users/Dig-Doug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dig-Doug/subscriptions","organizations_url":"https://api.github.com/users/Dig-Doug/orgs","repos_url":"https://api.github.com/users/Dig-Doug/repos","events_url":"https://api.github.com/users/Dig-Doug/events{/privacy}","received_events_url":"https://api.github.com/users/Dig-Doug/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-14T15:37:11Z","updated_at":"2018-11-14T15:37:11Z","closed_at":null,"author_association":"NONE","body":"Hi, I'm running into an issue with the `npm_install` rule. For some reason, the `npm_install` rule fails on my `package.json`, but when I switch to the `yarn_install` rule, everything works fine. Running `npm install` without bazel in the directory also works.\r\n\r\n## Steps to reproduce\r\n```\r\ngit clone https://github.com/Dig-Doug/ts-protoc-gen.git\r\ncd ts-protoc-gen\r\ngit checkout 1bd65c9d7b710aabbd9d2e179e082692090598db\r\nbazel test //test/bazel/...:all\r\n\r\n# Build fails\r\nStarting local Bazel server and connecting to it...\r\nINFO: SHA256 (https://github.com/bazelbuild/rules_nodejs/archive/0.15.1.zip) = a0a91a2e0cee32e9304f1aeea9e6c1b611afba548058c5980217d44ee11e3dd7\r\nINFO: SHA256 (https://codeload.github.com/google/protobuf/zip/48cb18e5c419ddd23d9badcfe4e9df7bde1979b2) = b6b42f90c60b54732f764ae875623a9b05e6eede064173c36c6fea12dd376cdd\r\nERROR: /home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen/bin/BUILD.bazel:5:1: no such package '@ts_protoc_gen_deps//': Traceback (most recent call last):\r\n\tFile \"/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl\", line 107\r\n\t\t_create_build_file(repository_ctx, node)\r\n\tFile \"/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl\", line 32, in _create_build_file\r\n\t\tfail((\"node failed: \\nSTDOUT:\\n%s\\nST...)))\r\nnode failed: \r\nSTDOUT:\r\n\r\nSTDERR:\r\n/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:283\r\n            throw new Error(`Could not find ${depType} '${targetDep}' of '${dep._dir}'`)\r\n            ^\r\n\r\nError: Could not find peer dependency 'karma' of 'karma-jasmine'\r\n    at Object.keys.map.targetDep (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:283:19)\r\n    at Array.map (<anonymous>)\r\n    at findDeps (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:267:10)\r\n    at flattenDependencies (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:301:3)\r\n    at pkgs.forEach.pkg (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:81:23)\r\n    at Array.forEach (<anonymous>)\r\n    at main (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:81:8)\r\n    at Object.<anonymous> (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:54:3)\r\n    at Module._compile (module.js:635:30)\r\n    at Object.Module._extensions..js (module.js:646:10)\r\n and referenced by '@ts_protoc_gen//bin:protoc-gen-ts_bin'\r\nERROR: Analysis of target '//test/bazel/proto:pizza_service_ts_proto' failed; build aborted: no such package '@ts_protoc_gen_deps//': Traceback (most recent call last):\r\n\tFile \"/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl\", line 107\r\n\t\t_create_build_file(repository_ctx, node)\r\n\tFile \"/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl\", line 32, in _create_build_file\r\n\t\tfail((\"node failed: \\nSTDOUT:\\n%s\\nST...)))\r\nnode failed: \r\nSTDOUT:\r\n\r\nSTDERR:\r\n/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:283\r\n            throw new Error(`Could not find ${depType} '${targetDep}' of '${dep._dir}'`)\r\n            ^\r\n\r\nError: Could not find peer dependency 'karma' of 'karma-jasmine'\r\n    at Object.keys.map.targetDep (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:283:19)\r\n    at Array.map (<anonymous>)\r\n    at findDeps (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:267:10)\r\n    at flattenDependencies (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:301:3)\r\n    at pkgs.forEach.pkg (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:81:23)\r\n    at Array.forEach (<anonymous>)\r\n    at main (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:81:8)\r\n    at Object.<anonymous> (/home/doug/.cache/bazel/_bazel_doug/b05db80e2dc3f398f49b0e15d16c5b02/external/ts_protoc_gen_deps/generate_build_file.js:54:3)\r\n    at Module._compile (module.js:635:30)\r\n    at Object.Module._extensions..js (module.js:646:10)\r\nINFO: Elapsed time: 23.447s\r\nINFO: 0 processes.\r\nFAILED: Build did NOT complete successfully (470 packages loaded, 20900 targets configured)\r\nFAILED: Build did NOT complete successfully (470 packages loaded, 20900 targets configured)\r\n\r\n\r\n# Edit ./defs.bzl, at the bottom of the file inside typescript_proto_dependencies()\r\n# Comment out the npm_install and uncomment yarn_install\r\nbazel test //test/bazel/...:all\r\n\r\n# Tests pass\r\n```\r\n\r\nThanks for your help!"}}
{"actor":{"display_login":"Dig-Doug"}}