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

[Bug]: Not able to install it using GitHub address in Node 16 #3777

Closed
sassanh opened this issue Aug 27, 2022 · 5 comments · Fixed by #3779
Closed

[Bug]: Not able to install it using GitHub address in Node 16 #3777

sassanh opened this issue Aug 27, 2022 · 5 comments · Fixed by #3779
Labels

Comments

@sassanh
Copy link

sassanh commented Aug 27, 2022

Version

28.0.8

Steps to reproduce

Install it using GitHub repository address git+https://github.com/kulshekhar/ts-jest.git
Try to run npm ci in Github Actions with NodeJS version 16.

Expected behavior

ts-jest to be built and installed.

Actual behavior

It will fail to install ts-jest with this error:

npm ERR! /home/runner/.npm/_cacache/tmp/git-clonevJa6QI/node_modules/execa/index.js:212
[26](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:27)
npm ERR! 		throw error;
[27](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:28)
npm ERR! 		^
[28](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:29)
npm ERR! 
[29](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:30)
npm ERR! Error: Command failed with exit code 128: git diff-index --name-only HEAD
[30](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:31)
npm ERR! fatal: not a git repository (or any of the parent directories): .git
[31](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:32)
npm ERR!     at makeError (/home/runner/.npm/_cacache/tmp/git-clonevJa6QI/node_modules/execa/lib/error.js:60:11)
[32](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:33)
npm ERR!     at Function.module.exports.sync (/home/runner/.npm/_cacache/tmp/git-clonevJa6QI/node_modules/execa/index.js:194:17)
[33](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:34)
npm ERR!     at Object.<anonymous> (/home/runner/.npm/_cacache/tmp/git-clonevJa6QI/scripts/post-build.js:5:11)
[34](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:35)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1105:14)
[35](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:36)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
[36](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:37)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
[37](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:38)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[38](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:39)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
[39](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:40)
npm ERR!     at node:internal/main/run_main_module:17:47 {
[40](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:41)
npm ERR!   shortMessage: 'Command failed with exit code 128: git diff-index --name-only HEAD',
[41](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:42)
npm ERR!   command: 'git diff-index --name-only HEAD',
[42](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:43)
npm ERR!   escapedCommand: 'git diff-index --name-only HEAD',
[43](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:44)
npm ERR!   exitCode: 128,
[44](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:45)
npm ERR!   signal: undefined,
[45](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:46)
npm ERR!   signalDescription: undefined,
[46](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:47)
npm ERR!   stdout: '',
[47](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:48)
npm ERR!   stderr: 'fatal: not a git repository (or any of the parent directories): .git',
[48](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:49)
npm ERR!   failed: true,
[49](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:50)
npm ERR!   timedOut: false,
[50](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:51)
npm ERR!   isCanceled: false,
[51](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:52)
npm ERR!   killed: false
[52](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:53)
npm ERR! }
[53](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:54)
npm ERR! npm ERR! code 1
[54](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:55)
npm ERR! npm ERR! path /home/runner/.npm/_cacache/tmp/git-clonevJa6QI
[55](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:56)
npm ERR! npm ERR! command failed
[56](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:57)
npm ERR! npm ERR! command sh -c npm run build
[57](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:58)
npm ERR! 
[58](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:59)
npm ERR! npm ERR! A complete log of this run can be found in:
[59](https://github.com/sassanh/template-to-pdf/runs/8051920469?check_suite_focus=true#step:4:60)
npm ERR! npm ERR!     /home/runner/.npm/_

Debug log

Not applicable

Additional context

I'm doing this because this pull request is not released yet: #3767
This is the line that's causing the issue: https://github.com/kulshekhar/ts-jest/blob/main/scripts/post-build.js#L5
I think in NPM associated with Node 16 .git is removed the repository is cloned. Is there any other way we can have that condition without running git?

Environment

System: Github Actions infrastructure, ubuntu-latest
Node: 16
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 28, 2022

If you manually remove .git after cloning, it should work. Besides, this is not a bug. Please use GitHub Discussion next time with this kind of question. Thank you:)

@ahnpnl ahnpnl closed this as completed Aug 28, 2022
@ahnpnl ahnpnl added Not An Issue Not ts-jest issue and removed Bug Report Needs Triage labels Aug 28, 2022
@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 28, 2022

Also, you can easily remove that post build thing from package.json.

@sassanh
Copy link
Author

sassanh commented Aug 28, 2022

@ahnpnl Thanks for quick response and sorry if I initiated this discussion in a wrong place.
I guess there is a misunderstanding, I'm not trying to manually install this package. I'm trying to install it using this command:

npm install https://github.com/kulshekhar/ts-jest.git

Most npm packages can be installed like this but ts-jest fails because of the issue I mentioned above.

So I believe this is a bug (a problem in the software that can be fixed.)

Maybe we can change that line to first check if this is actually a valid git repository before running the git command.

@ahnpnl
Copy link
Collaborator

ahnpnl commented Aug 28, 2022

Your case is valid but it’s a rare case to run npm install in that way. The problem belongs to infrastructure rather than production software itself.

Feel free to submit a PR for such an issue.

@sassanh
Copy link
Author

sassanh commented Aug 28, 2022

Thanks! :-)

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

Successfully merging a pull request may close this issue.

2 participants