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

pre-commit.ci fails to install with npm's --dev dependencies. #427

Open
bdice opened this issue Apr 10, 2024 · 2 comments
Open

pre-commit.ci fails to install with npm's --dev dependencies. #427

bdice opened this issue Apr 10, 2024 · 2 comments

Comments

@bdice
Copy link

bdice commented Apr 10, 2024

I would like to use this repository's pre-commit hooks with pre-commit.ci. However, it looks like this is not possible because the development dependencies include puppeteer which installs Chromium (if I'm reading this correctly). Here is the log.
https://results.pre-commit.ci/run/github/168426142/1711990670.ELxuaVPpR1CviNOJqJh8Kw

This behavior broke between v1.8.5 → v1.11.0.

build attempt 1...
    => error
    [INFO] Installing environment for https://github.com/FlamingTempura/bibtex-tidy.
    [INFO] Once installed this environment will be reused.
    [INFO] This may take a few minutes...
    An unexpected error has occurred: CalledProcessError: command: ('/pc/clone/XfjFjNt7Squa3kp4KYxEog/node_env-system/bin/node', '/opt/node/bin/npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
    return code: 1
    stdout: (none)
    stderr:
        npm WARN config dev Please use --include=dev instead.
        npm WARN config production Use `--omit=dev` instead.
        npm notice 
        npm notice New major version of npm available! 9.6.7 -> 10.5.0
        npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.5.0>
        npm notice Run `npm install -g npm@10.5.0` to update!
        npm notice 
        npm ERR! code 1
        npm ERR! path /pc/clone/XfjFjNt7Squa3kp4KYxEog/node_modules/puppeteer
        npm ERR! command failed
        npm ERR! command sh -c node install.js
        npm ERR! ERROR: Failed to set up Chromium r1108766! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
        npm ERR! [Error: ENOENT: no such file or directory, mkdir '/src/.cache'] {
        npm ERR!   errno: -2,
        npm ERR!   code: 'ENOENT',
        npm ERR!   syscall: 'mkdir',
        npm ERR!   path: '/src/.cache'
        npm ERR! }
    
        npm ERR! A complete log of this run can be found in: /tmp/npm/_logs/2024-04-01T17_00_39_617Z-debug-0.log
    Check the log at /pc/pre-commit.log
build attempt 2...
    => error
    [INFO] Installing environment for https://github.com/FlamingTempura/bibtex-tidy.
    [INFO] Once installed this environment will be reused.
    [INFO] This may take a few minutes...
    An unexpected error has occurred: CalledProcessError: command: ('/pc/clone/XfjFjNt7Squa3kp4KYxEog/node_env-system/bin/node', '/opt/node/bin/npm', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
    return code: 1
    stdout: (none)
    stderr:
        npm WARN config dev Please use --include=dev instead.
        npm WARN config production Use `--omit=dev` instead.
        npm ERR! code 1
        npm ERR! path /pc/clone/XfjFjNt7Squa3kp4KYxEog/node_modules/puppeteer
        npm ERR! command failed
        npm ERR! command sh -c node install.js
        npm ERR! ERROR: Failed to set up Chromium r1108766! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
        npm ERR! [Error: ENOENT: no such file or directory, mkdir '/src/.cache'] {
        npm ERR!   errno: -2,
        npm ERR!   code: 'ENOENT',
        npm ERR!   syscall: 'mkdir',
        npm ERR!   path: '/src/.cache'
        npm ERR! }
    
        npm ERR! A complete log of this run can be found in: /tmp/npm/_logs/2024-04-01T17_00_49_364Z-debug-0.log
    Check the log at /pc/pre-commit.log
@bdice bdice changed the title pre-commit.ci fails to install with --dev dependencies. pre-commit.ci fails to install with npm's --dev dependencies. Apr 10, 2024
@njzjz
Copy link

njzjz commented Apr 19, 2024

I encountered the same issue. As a workaround, I created a new repository mirrors-bibtex-tidy which doesn't need to install the development dependencies.

  - repo: https://github.com/njzjz/mirrors-bibtex-tidy
    rev: v1.11.0
    hooks:
      - id: bibtex-tidy

I can transfer it to the author of bibtex-tidy if the author would like to maintain it.

@FlamingTempura
Copy link
Owner

Thanks @njzjz. A PR for this would be most welcome.

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

No branches or pull requests

3 participants