zkat / npx

execute npm package binaries (moved)
https://github.com/npm/npx
Other
2.63k stars 105 forks source link

NPX fails to get private github repos #152

Closed Treyone closed 6 years ago

Treyone commented 6 years ago

I use npx inside a Docker container, during the build.

node : v8.9.4
npm : 5.6.0

The ssh key is present, cloning git@github.com:my-company/my-repo, then npm install and run works. However, running npx my-company/my-repo crashes with the following error :

npm ERR! code 2
npm ERR! Command failed: /usr/bin/git submodule update -q --init --recursive
npm ERR! /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Mu�ù�9�$~��؜��4�Úr��l�z�^��Y��,U�6č�[�ꮬe�0�~��5��7�N0��~�-V�Kčk: not found
npm ERR! /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: dCh���]�sP: not found
npm ERR! /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Q��L]�槏.�1^G�iT�Aq��٧���}��α/��: not found
npm ERR! /usr/lib/git-core/git-submodule: 2: /usr/lib/git-core/git-submodule: Syntax error: ")" unexpected
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-01-23T16_12_11_999Z-debug.log
Install for github:my-company/my-repo failed with code 1

The mentioned log file contains the following :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/lib/node_modules/npm/bin/npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'github:my-company/my-repo',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   '/root/.npm/_npx/421',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json' ]
2 info using npm@5.6.0
3 info using node@v8.9.4
4 verbose npm-session db7a7362261f69fc
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for github:my-company/my-repo Command failed: /usr/bin/git submodule update -q
--init --recursive
7 silly fetchPackageMetaData /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Mu�ù�9�$~��؜��4�Úr��l�z�^��Y��,U�6č�[�ꮬe�0�~
��5��7�N0��~�-V�Kčk: not found
7 silly fetchPackageMetaData /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: dCh���]�sP: not found
7 silly fetchPackageMetaData /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Q��L]�槏.�1^G�iT�Aq��٧���}��α/��: no
t found
7 silly fetchPackageMetaData /usr/lib/git-core/git-submodule: 2: /usr/lib/git-core/git-submodule: Syntax error: ")"
unexpected
8 verbose stack Error: Command failed: /usr/bin/git submodule update -q --init --recursive
8 verbose stack /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Mu�ù�9�$~��؜��4�Úr��l�z�^��Y��,U�6č�[�ꮬe�0�~��5��7�N0��~�-V�Kčk: no
t found
8 verbose stack /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: dCh���]�sP: not found
8 verbose stack /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Q��L]�槏.�1^G�iT�Aq��٧���}��α/��: not found
8 verbose stack /usr/lib/git-core/git-submodule: 2: /usr/lib/git-core/git-submodule: Syntax error: ")" unexpected
8 verbose stack
8 verbose stack     at ChildProcess.exithandler (child_process.js:275:12)
8 verbose stack     at emitTwo (events.js:126:13)
8 verbose stack     at ChildProcess.emit (events.js:214:7)
8 verbose stack     at maybeClose (internal/child_process.js:925:16)
8 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
9 verbose cwd /apps/stoic-portal
10 verbose Linux 4.9.75-linuxkit-aufs
11 verbose argv "/usr/bin/node" "/usr/lib/node_modules/npm/bin/npm-cli.js" "install" "github:my-company/my-repo" "
--global" "--prefix" "/root/.npm/_npx/421" "--loglevel" "error" "--json"
12 verbose node v8.9.4
13 verbose npm  v5.6.0
14 error code 2
15 error Command failed: /usr/bin/git submodule update -q --init --recursive
15 error /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Mu�ù�9�$~��؜��4�Úr��l�z�^��Y��,U�6č�[�ꮬe�0�~��5��7�N0��~�-V�Kčk: not found
15 error /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: dCh���]�sP: not found
15 error /usr/lib/git-core/git-submodule: 1: /usr/lib/git-core/git-submodule: �Q��L]�槏.�1^G�iT�Aq��٧���}��α/��: not found
15 error /usr/lib/git-core/git-submodule: 2: /usr/lib/git-core/git-submodule: Syntax error: ")" unexpected
16 verbose exit [ 1, true ]

These messages made me accuse git at first, but as everything works fine when executed without npx, I've come to suspect it. It was working like a charm in previous images build with older node and npm versions. Am Imissing something ?

Treyone commented 6 years ago

Well, I still can't explain it but it's clearly not related to npx, therefore I close this, sorry for the noise.

npm i my-company/my-repo provides the same output. Git clone works. I forced a re-installation of the git package (same version) and it works.