question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node/Npm hooks still fails in Windows

See original GitHub issue

search tried in the issue tracker

2351

describe your issue

On Windows I am still experiencing an issue similar to #2351 . I tried https://stackoverflow.com/questions/71939099/bitbucket-pipeline-error-installing-pre-commit-ts-lint but setting any version still fails with the same error.

I was running this from: cmd as well as Git Bash, in a conda environment

I also tried using the system node (with node 16.3.0 and 18.2.0) too but then it complains about:

D:\workspace\cookiecutter-alpha-build-polyrepo-py>pre-commit run --all-files
[WARNING] The 'rev' field of repo 'https://github.com/maximevast/pre-commit-tslint' appears to be a mutable reference (moving tag / branch).  Mutable references are never updated after first install and are not supported.  See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.  Hint: `pre-commit autoupdate` often fixes this.
[INFO] Installing environment for https://github.com/maximevast/pre-commit-tslint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('d:\\miniconda3\\python.exe', '-mnodeenv', '--prebuilt', '--clean-src', '\\\\?\\C:\\Users\\Cristian Matache\\.cache\\pre-commit\\repov2e2zaal\\node_env-system', '-n', 'system')
return code: 1
expected return code: 0
stdout: (none)
stderr:
    Installing system node.js on win32 is not supported!

Check the log at C:\Users\Cristian Matache\.cache\pre-commit\pre-commit.log

pre-commit --version

pre-commit 2.19.0

.pre-commit-config.yaml

repos:
-   repo: https://github.com/maximevast/pre-commit-tslint
    rev: ''
    hooks:
    -   id: tslint
        language_version: 16.3.0

~/.cache/pre-commit/pre-commit.log (if present)

version information

pre-commit version: 2.19.0
git --version: git version 2.31.0.windows.1
sys.version:
    3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]
sys.executable: d:\miniconda3\python.exe
os.name: nt
sys.platform: win32

error information

An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Cristian Matache\\.cache\\pre-commit\\repov2e2zaal\\node_env-16.3.0\\Scripts\\npm.CMD', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
expected return code: 0
stdout:

    up to date, audited 1 package in 3s

    found 0 vulnerabilities

stderr:
    The system cannot find the path specified.
    The system cannot find the path specified.
    npm WARN install Usage of the `--dev` option is deprecated. Use `--include=dev` instead.

Traceback (most recent call last):
  File "d:\miniconda3\lib\site-packages\pre_commit\error_handler.py", line 73, in error_handler
    yield
  File "d:\miniconda3\lib\site-packages\pre_commit\main.py", line 389, in main
    return run(args.config, store, args)
  File "d:\miniconda3\lib\site-packages\pre_commit\commands\run.py", line 414, in run
    install_hook_envs(to_install, store)
  File "d:\miniconda3\lib\site-packages\pre_commit\repository.py", line 223, in install_hook_envs
    _hook_install(hook)
  File "d:\miniconda3\lib\site-packages\pre_commit\repository.py", line 79, in _hook_install
    lang.install_environment(
  File "d:\miniconda3\lib\site-packages\pre_commit\languages\node.py", line 111, in install_environment
    helpers.run_setup_cmd(prefix, local_install_cmd)
  File "d:\miniconda3\lib\site-packages\pre_commit\languages\helpers.py", line 51, in run_setup_cmd
    cmd_output_b(*cmd, cwd=prefix.prefix_dir, **kwargs)
  File "d:\miniconda3\lib\site-packages\pre_commit\util.py", line 146, in cmd_output_b
    raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('C:\\Users\\Cristian Matache\\.cache\\pre-commit\\repov2e2zaal\\node_env-16.3.0\\Scripts\\npm.CMD', 'install', '--dev', '--prod', '--ignore-prepublish', '--no-progress', '--no-save')
return code: 1
expected return code: 0
stdout:

    up to date, audited 1 package in 3s

    found 0 vulnerabilities

stderr:
    The system cannot find the path specified.
    The system cannot find the path specified.
    npm WARN install Usage of the `--dev` option is deprecated. Use `--include=dev` instead.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

0reactions
YouJiachengcommented, Sep 12, 2022

Wow, you save my day. Actually AutoRun just broke my vscode-remote-ssh few days ago, and it broke my pyright pre-commit today. I don’t know conda will change it! Thanks!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to fix many errors during npm install - Stack Overflow
Tried to clone and re-install several times but errors persist. Also, tried to npm install/update --force, deleting node_modules and package- ...
Read more >
CI: Husky pre-commit hook fails when running in Github for ...
I have the windows install for Git already, unfortunately, so it's likely that isn't the issue. npm-which node/npm-which node.exe both return C ...
Read more >
ts-node - npm
This tells any node processes which receive this environment variable to install ts-node 's hooks before executing other code.
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
I'm getting the error because I'm trying to import the freeCodeCamp icon from the react-icons package, which I don't have installed.
Read more >
How to completely uninstall Node.js and npm from Windows
Go to the windows control panel and click on Uninstall a program , select Node.js and click on uninstall tab to uninstall the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found