npm / npm/cli

[BUG] install github private package error

Open
#3,169 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug platform:windows Release 7.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Current Behavior:

Install github private package error with npm install git+ssh://git@github.com:<private github org>/<private package>.git#<branch>

My coworker installed it succesfully on Macbook, but I Failed on WSL Windows 10.

Expected Behavior:

Install succeed

Steps To Reproduce:
  1. Install package by npm install git+ssh://git@github.com:<private github org>/<private package>.git#<branch>

  2. Error in console

[                  ] - reify:protobufjs: timing reifyNode:node_modules/kafkajs Completed in 1058ms
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/mufid/.npm --prefer-offline=false --prefer-online=fa
lse --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code ECONNREFUSED
npm ERR! npm ERR! syscall connect
npm ERR! npm ERR! errno ECONNREFUSED
npm ERR! npm ERR! FetchError: request to http://localhost:4873/yocto-queue/-/yocto-queue-0.1.0.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:4873
npm ERR! npm ERR!     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
npm ERR! npm ERR!     at ClientRequest.emit (node:events:365:28)
npm ERR! npm ERR!     at Socket.socketErrorListener (node:_http_client:447:9)
npm ERR! npm ERR!     at Socket.emit (node:events:377:35)
npm ERR! npm ERR!     at emitErrorNT (node:internal/streams/destroy:193:8)
npm ERR! npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:158:3)
npm ERR! npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! npm ERR!  FetchError: request to http://localhost:4873/yocto-queue/-/yocto-queue-0.1.0.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:4873
npm ERR! npm ERR!     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
npm ERR! npm ERR!     at ClientRequest.emit (node:events:365:28)
npm ERR! npm ERR!     at Socket.socketErrorListener (node:_http_client:447:9)
npm ERR! npm ERR!     at Socket.emit (node:events:377:35)
npm ERR! npm ERR!     at emitErrorNT (node:internal/streams/destroy:193:8)
npm ERR! npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:158:3)
npm ERR! npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! npm ERR!   code: 'ECONNREFUSED',
npm ERR! npm ERR!   errno: 'ECONNREFUSED',
npm ERR! npm ERR!   syscall: 'connect',
npm ERR! npm ERR!   address: '127.0.0.1',
npm ERR! npm ERR!   port: 4873,
npm ERR! npm ERR!   type: 'system'
npm ERR! npm ERR! }
npm ERR! npm ERR!
npm ERR! npm ERR! If you are behind a proxy, please make sure that the
npm ERR! npm ERR! 'proxy' config is set properly.  See: 'npm help config'
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /home/mufid/.npm/_logs/2021-04-30T09_37_58_896Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mufid/.npm/_logs/2021-04-30T09_37_59_944Z-debug.log

  1. Error log
0 verbose cli [
0 verbose cli   '/usr/bin/node',
0 verbose cli   '/usr/bin/npm',
0 verbose cli   'install',
0 verbose cli   'git+ssh://git@github.com:<private github org>/<private package>.git#<branch>'
0 verbose cli ]
1 info using npm@7.11.1
2 info using node@v16.0.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/mnt/d/<project>/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/mufid/.npmrc Completed in 2ms
12 timing config:load:user Completed in 2ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 10ms
19 timing npm:load:configload Completed in 10ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 1ms
22 timing npm:load:cleanupLog Completed in 1ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 1ms
25 timing npm:load Completed in 15ms
26 timing config:load:flatten Completed in 2ms
27 timing arborist:ctor Completed in 0ms
28 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
29 timing idealTree:init Completed in 900ms
30 timing idealTree:userRequests Completed in 9271ms
31 silly idealTree buildDeps
32 silly fetch manifest @<library name>/core@git+ssh://git@github.com:<private github org>/<private package>.git#<branch>
33 silly fetch manifest @nestjs/common@^7.6.14
34 http fetch GET 304 https://registry.npmjs.org/@nestjs%2fcommon 597ms (from cache)
35 silly fetch manifest cache-manager@^3.4.0
36 http fetch GET 304 https://registry.npmjs.org/cache-manager 277ms (from cache)
37 silly fetch manifest class-transformer@^0.3.1
38 http fetch GET 304 https://registry.npmjs.org/class-transformer 162ms (from cache)
39 silly fetch manifest class-validator@^0.12.2
40 http fetch GET 304 https://registry.npmjs.org/class-validator 126ms (from cache)
41 silly fetch manifest reflect-metadata@^0.1.13
42 http fetch GET 304 https://registry.npmjs.org/reflect-metadata 118ms (from cache)
43 silly fetch manifest rxjs@^6.5.4
44 http fetch GET 304 https://registry.npmjs.org/rxjs 148ms (from cache)
45 silly fetch manifest @nestjs/core@^7.6.14
46 http fetch GET 304 https://registry.npmjs.org/@nestjs%2fcore 187ms (from cache)
47 silly fetch manifest @nestjs/microservices@^7.6.14
48 http fetch GET 304 https://registry.npmjs.org/@nestjs%2fmicroservices 409ms (from cache)
49 silly fetch manifest @nestjs/websockets@^7.0.0
50 http fetch GET 304 https://registry.npmjs.org/@nestjs%2fwebsockets 196ms (from cache)
51 silly fetch manifest amqp-connection-manager@*
52 http fetch GET 304 https://registry.npmjs.org/amqp-connection-manager 165ms (from cache)
53 silly fetch manifest amqplib@*
54 http fetch GET 304 https://registry.npmjs.org/amqplib 124ms (from cache)
55 silly fetch manifest grpc@*
56 http fetch GET 304 https://registry.npmjs.org/grpc 140ms (from cache)
57 silly fetch manifest kafkajs@*
58 http fetch GET 304 https://registry.npmjs.org/kafkajs 138ms (from cache)
59 silly fetch manifest mqtt@*
60 http fetch GET 304 https://registry.npmjs.org/mqtt 157ms (from cache)
61 silly fetch manifest nats@*
62 http fetch GET 304 https://registry.npmjs.org/nats 154ms (from cache)
63 silly fetch manifest redis@^3.0.2
64 http fetch GET 304 https://registry.npmjs.org/redis 156ms (from cache)
65 silly fetch manifest @nestjs/platform-express@^7.6.14
66 http fetch GET 304 https://registry.npmjs.org/@nestjs%2fplatform-express 178ms (from cache)
67 silly placeDep ROOT @<library>/core@1.0.8 OK for: <library>@0.0.1 want: @<library name>/core@git+ssh://git@github.com:<private github org>/<private package>.git#<branch>
68 silly fetch manifest @kafkajs/confluent-schema-registry@^2.0.1
69 silly fetch manifest kafkajs@^1.15.0
70 http fetch GET 304 https://registry.npmjs.org/@kafkajs%2fconfluent-schema-registry 479ms (from cache)
71 timing idealTree:#root Completed in 9901ms
72 silly placeDep ROOT @kafkajs/confluent-schema-registry@2.0.1 OK for: @ms-utils-nestjs/core@1.0.8 want: ^2.0.1
73 silly placeDep ROOT kafkajs@1.15.0 OK for: @ms-utils-nestjs/core@1.0.8 want: ^1.15.0
74 silly fetch manifest ajv@^7.1.0
75 silly fetch manifest avsc@>= 5.4.13 < 6
76 silly fetch manifest mappersmith@>= 2.30.1 < 3
77 silly fetch manifest protobufjs@^6.10.1
78 http fetch GET 304 https://registry.npmjs.org/ajv 178ms (from cache)
79 http fetch GET 304 https://registry.npmjs.org/avsc 324ms (from cache)
80 http fetch GET 304 https://registry.npmjs.org/mappersmith 350ms (from cache)
81 http fetch GET 304 https://registry.npmjs.org/protobufjs 354ms (from cache)
82 timing idealTree:node_modules/@ms-utils-nestjs/core Completed in 367ms
83 silly placeDep node_modules/@kafkajs/confluent-schema-registry ajv@7.2.4 OK for: @kafkajs/confluent-schema-registry@2.0.1 want: ^7.1.0
84 silly placeDep ROOT avsc@5.6.2 OK for: @kafkajs/confluent-schema-registry@2.0.1 want: >= 5.4.13 < 6
85 silly placeDep ROOT mappersmith@2.34.0 OK for: @kafkajs/confluent-schema-registry@2.0.1 want: >= 2.30.1 < 3
86 silly placeDep ROOT protobufjs@6.11.1 OK for: @kafkajs/confluent-schema-registry@2.0.1 want: ^6.10.1
87 silly fetch manifest json-schema-traverse@^1.0.0
88 silly fetch manifest @protobufjs/aspromise@^1.1.2
89 silly fetch manifest @protobufjs/base64@^1.1.2
90 silly fetch manifest @protobufjs/codegen@^2.0.4
91 silly fetch manifest @protobufjs/eventemitter@^1.1.0
92 silly fetch manifest @protobufjs/fetch@^1.1.0
93 silly fetch manifest @protobufjs/float@^1.0.2
94 silly fetch manifest @protobufjs/inquire@^1.1.0
95 silly fetch manifest @protobufjs/path@^1.1.2
96 silly fetch manifest @protobufjs/pool@^1.1.0
97 silly fetch manifest @protobufjs/utf8@^1.1.0
98 silly fetch manifest @types/long@^4.0.1
99 http fetch GET 304 https://registry.npmjs.org/json-schema-traverse 182ms (from cache)
100 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2ffetch 193ms (from cache)
101 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2ffloat 194ms (from cache)
102 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2faspromise 265ms (from cache)
103 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2fpath 421ms (from cache)
104 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2fpool 423ms (from cache)
105 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2fcodegen 459ms (from cache)
106 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2feventemitter 469ms (from cache)
107 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2futf8 463ms (from cache)
108 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2fbase64 476ms (from cache)
109 http fetch GET 304 https://registry.npmjs.org/@protobufjs%2finquire 471ms (from cache)
110 http fetch GET 304 https://registry.npmjs.org/@types%2flong 481ms (from cache)
111 timing idealTree:node_modules/@kafkajs/confluent-schema-registry Completed in 505ms
112 timing idealTree:node_modules/avsc Completed in 0ms
113 timing idealTree:node_modules/kafkajs Completed in 0ms
114 timing idealTree:node_modules/mappersmith Completed in 0ms
115 silly placeDep ROOT @protobufjs/aspromise@1.1.2 OK for: protobufjs@6.11.1 want: ^1.1.2
116 silly placeDep ROOT @protobufjs/base64@1.1.2 OK for: protobufjs@6.11.1 want: ^1.1.2
117 silly placeDep ROOT @protobufjs/codegen@2.0.4 OK for: protobufjs@6.11.1 want: ^2.0.4
118 silly placeDep ROOT @protobufjs/eventemitter@1.1.0 OK for: protobufjs@6.11.1 want: ^1.1.0
119 silly placeDep ROOT @protobufjs/fetch@1.1.0 OK for: protobufjs@6.11.1 want: ^1.1.0
120 silly placeDep ROOT @protobufjs/float@1.0.2 OK for: protobufjs@6.11.1 want: ^1.0.2
121 silly placeDep ROOT @protobufjs/inquire@1.1.0 OK for: protobufjs@6.11.1 want: ^1.1.0
122 silly placeDep ROOT @protobufjs/path@1.1.2 OK for: protobufjs@6.11.1 want: ^1.1.2
123 silly placeDep ROOT @protobufjs/pool@1.1.0 OK for: protobufjs@6.11.1 want: ^1.1.0
124 silly placeDep ROOT @protobufjs/utf8@1.1.0 OK for: protobufjs@6.11.1 want: ^1.1.0
125 silly placeDep ROOT @types/long@4.0.1 OK for: protobufjs@6.11.1 want: ^4.0.1
126 timing idealTree:node_modules/protobufjs Completed in 8ms
127 timing idealTree:node_modules/@protobufjs/aspromise Completed in 0ms
128 timing idealTree:node_modules/@protobufjs/base64 Completed in 0ms
129 timing idealTree:node_modules/@protobufjs/codegen Completed in 0ms
130 timing idealTree:node_modules/@protobufjs/eventemitter Completed in 0ms
131 timing idealTree:node_modules/@protobufjs/fetch Completed in 0ms
132 timing idealTree:node_modules/@protobufjs/float Completed in 0ms
133 timing idealTree:node_modules/@protobufjs/inquire Completed in 0ms
134 timing idealTree:node_modules/@protobufjs/path Completed in 0ms
135 timing idealTree:node_modules/@protobufjs/pool Completed in 0ms
136 timing idealTree:node_modules/@protobufjs/utf8 Completed in 0ms
137 timing idealTree:node_modules/@types/long Completed in 0ms
138 silly placeDep node_modules/@kafkajs/confluent-schema-registry json-schema-traverse@1.0.0 OK for: ajv@7.2.4 want: ^1.0.0
139 timing idealTree:node_modules/@kafkajs/confluent-schema-registry/node_modules/ajv Completed in 1ms
140 timing idealTree:node_modules/@kafkajs/confluent-schema-registry/node_modules/json-schema-traverse Completed in 0ms
141 timing idealTree:buildDeps Completed in 10784ms
142 timing idealTree:fixDepFlags Completed in 19ms
143 timing idealTree Completed in 20992ms
144 timing reify:loadTrees Completed in 20994ms
145 timing reify:diffTrees Completed in 86ms
146 silly reify moves {}
147 timing reify:retireShallow Completed in 0ms
148 timing reify:createSparse Completed in 20ms
149 timing reify:loadBundles Completed in 1ms
150 verbose reify failed optional dependency /mnt/d/<project>/node_modules/fsevents
151 silly reify mark deleted [
151 silly reify   '/mnt/d/<project>/node_modules/fsevents'
151 silly reify ]
152 timing reifyNode:node_modules/fsevents Completed in 6ms
153 timing reifyNode:node_modules/@types/long Completed in 197ms
154 timing reifyNode:node_modules/@protobufjs/fetch Completed in 214ms
155 timing reifyNode:node_modules/@protobufjs/aspromise Completed in 215ms
156 timing reifyNode:node_modules/@protobufjs/eventemitter Completed in 216ms
157 timing reifyNode:node_modules/@protobufjs/codegen Completed in 216ms
158 timing reifyNode:node_modules/@protobufjs/base64 Completed in 216ms
159 timing reifyNode:node_modules/@protobufjs/pool Completed in 218ms
160 timing reifyNode:node_modules/@protobufjs/path Completed in 219ms
161 timing reifyNode:node_modules/@protobufjs/utf8 Completed in 226ms
162 timing reifyNode:node_modules/@protobufjs/float Completed in 231ms
163 timing reifyNode:node_modules/@protobufjs/inquire Completed in 236ms
164 timing reifyNode:node_modules/@kafkajs/confluent-schema-registry/node_modules/json-schema-traverse Completed in 248ms
165 timing reifyNode:node_modules/avsc Completed in 295ms
166 timing reifyNode:node_modules/@kafkajs/confluent-schema-registry Completed in 357ms
167 timing reifyNode:node_modules/mappersmith Completed in 361ms
168 http fetch GET 404 https://codeload.github.com/<github org>/<package>/tar.gz/90fe53b1a2b8e11fb8503be4ada454fbbc64cccb 475ms
169 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 814ms
170 timing auditReport:getReport Completed in 816ms
171 timing auditReport:init Completed in 0ms
172 timing reify:audit Completed in 816ms
173 timing reifyNode:node_modules/@kafkajs/confluent-schema-registry/node_modules/ajv Completed in 979ms
174 timing reifyNode:node_modules/kafkajs Completed in 1058ms
175 timing reifyNode:node_modules/protobufjs Completed in 1121ms
176 timing reify:rollback:createSparse Completed in 906ms
177 timing reify:rollback:retireShallow Completed in 0ms
178 timing command:install Completed in 113366ms
179 verbose stack Error: git dep preparation failed
179 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
179 verbose stack     at ChildProcess.emit (node:events:365:28)
179 verbose stack     at maybeClose (node:internal/child_process:1067:16)
179 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
180 verbose cwd /mnt/d/<project>
181 verbose Linux 4.4.0-19041-Microsoft
182 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "git+ssh://git@github.com:<organization>/<package>.git#development"
183 verbose node v16.0.0
184 verbose npm  v7.11.1
185 error code 1
186 error git dep preparation failed
187 error command /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/mufid/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
188 error npm WARN using --force Recommended protections disabled.
188 error npm ERR! code ECONNREFUSED
188 error npm ERR! syscall connect
188 error npm ERR! errno ECONNREFUSED
188 error npm ERR! FetchError: request to http://localhost:4873/yocto-queue/-/yocto-queue-0.1.0.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:4873
188 error npm ERR!     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
188 error npm ERR!     at ClientRequest.emit (node:events:365:28)
188 error npm ERR!     at Socket.socketErrorListener (node:_http_client:447:9)
188 error npm ERR!     at Socket.emit (node:events:377:35)
188 error npm ERR!     at emitErrorNT (node:internal/streams/destroy:193:8)
188 error npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:158:3)
188 error npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21)
188 error npm ERR!  FetchError: request to http://localhost:4873/yocto-queue/-/yocto-queue-0.1.0.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:4873
188 error npm ERR!     at ClientRequest.<anonymous> (/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
188 error npm ERR!     at ClientRequest.emit (node:events:365:28)
188 error npm ERR!     at Socket.socketErrorListener (node:_http_client:447:9)
188 error npm ERR!     at Socket.emit (node:events:377:35)
188 error npm ERR!     at emitErrorNT (node:internal/streams/destroy:193:8)
188 error npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:158:3)
188 error npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
188 error npm ERR!   code: 'ECONNREFUSED',
188 error npm ERR!   errno: 'ECONNREFUSED',
188 error npm ERR!   syscall: 'connect',
188 error npm ERR!   address: '127.0.0.1',
188 error npm ERR!   port: 4873,
188 error npm ERR!   type: 'system'
188 error npm ERR! }
188 error npm ERR!
188 error npm ERR! If you are behind a proxy, please make sure that the
188 error npm ERR! 'proxy' config is set properly.  See: 'npm help config'
188 error
188 error npm ERR! A complete log of this run can be found in:
188 error npm ERR!     /home/mufid/.npm/_logs/2021-04-30T09_37_58_896Z-debug.log
189 verbose exit 1

Environment:
  • OS: Windows 10 with Linux 18.04 WSL
  • Node: 16.0.0
  • npm: 7.1.1
  • npmrc: default instalation
  • npm proxy: null (default)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the npm install command in WSL and inspect the project and user .npmrc files mentioned in the log. Trace npm's git dependency preparation and the ECONNREFUSED request to localhost:4873. Done means the private GitHub package installs successfully in the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.