◐ Shell
reader mode source ↗
Skip to content

fix: Proper way of finding npm pack filename output.#3460

Open
ovcharenko wants to merge 1 commit into
pre-commit:mainfrom
ovcharenko:main
Open

fix: Proper way of finding npm pack filename output.#3460
ovcharenko wants to merge 1 commit into
pre-commit:mainfrom
ovcharenko:main

Conversation

@ovcharenko

Copy link
Copy Markdown

That will fix pollution of installation path with TypeScript output:

E           pre_commit.util.CalledProcessError: command: ('/private/var/folders/sd/qk6llt717b99lp1wgtym5qwm0000gn/T/pytest-of-local.user/pytest-16/test_node_typescript_hook_syst0/node_env-system/bin/node', '/opt/homebrew/bin/npm', 'install', '-g', '/private/var/folders/sd/qk6llt717b99lp1wgtym5qwm0000gn/T/pytest-of-local.user/pytest-16/test_node_typescript_hook_syst0/> t@0.0.1 prepare\n> tsc\n\nt-0.0.1.tgz')
E           return code: 254
E           stdout: (none)
E           stderr:
E               npm warn tarball tarball data for file:/private/var/folders/sd/qk6llt717b99lp1wgtym5qwm0000gn/T/pytest-of-local.user/pytest-16/test_node_typescript_hook_syst0/> t@0.0.1 prepare> tsct-0.0.1.tgz (null) seems to be corrupted. Trying again.
E               npm warn tarball tarball data for file:/private/var/folders/sd/qk6llt717b99lp1wgtym5qwm0000gn/T/pytest-of-local.user/pytest-16/test_node_typescript_hook_syst0/> t@0.0.1 prepare> tsct-0.0.1.tgz (null) seems to be corrupted. Trying again.
E               npm error code ENOENT
E               npm error syscall open
E               npm error path /private/var/folders/sd/qk6llt717b99lp1wgtym5qwm0000gn/T/pytest-of-local.user/pytest-16/test_node_typescript_hook_syst0/> t@0.0.1 prepare> tsct-0.0.1.tgz
E               npm error errno -2
E               npm error enoent ENOENT: no such file or directory, open '/private/var/folders/sd/qk6llt717b99lp1wgtym5qwm0000gn/T/pytest-of-local.user/pytest-16/test_node_typescript_hook_syst0/> t@0.0.1 prepare> tsct-0.0.1.tgz'
E               npm error enoent This is related to npm not being able to find a file.
E               npm error enoent
E               npm error A complete log of this run can be found in: /Users/local.user/.npm/_logs/2025-05-09T10_21_58_861Z-debug-0.log

@asottile

asottile commented May 9, 2025

Copy link
Copy Markdown
Member

the other branch which tried to solve this is here and my recommendation: #3259 (comment)

@ovcharenko

Copy link
Copy Markdown
Author

the other branch which tried to solve this is here and my recommendation: #3259 (comment)

That doesn't help much IMHO, because the JSON is part of other noisy output. So instead of one-line fix you will have to find JSON object and handle all error parsing.

@asottile

asottile commented May 9, 2025

Copy link
Copy Markdown
Member

pretty sure in json mode it does a better job of obscuring the nonsense

@ovcharenko

Copy link
Copy Markdown
Author

pretty sure in json mode it does a better job of obscuring the nonsense

19d0b42 should do this, right?

@ovcharenko ovcharenko changed the title fix: Process only the last line of npm pack output. May 9, 2025
@ovcharenko

Copy link
Copy Markdown
Author

@asottile any chance to get this merged any soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants