You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed on discord, I'm having an issue running prettier via pre-commit:
$ pre-commit --version
pre-commit 2.5.1
$ cat .pre-commit-config.yaml
repos:
- repo: https://github.com/prettier/prettier
rev: 2.0.5
hooks:
- id: prettier
$ pre-commit clean
Cleaned /home/rkm/.cache/pre-commit.
> pre-commit run prettier --files README.md
[INFO] Initializing environment for https://github.com/prettier/prettier.
[INFO] Installing environment for https://github.com/prettier/prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
prettier.................................................................Failed
- hook id: prettier
- exit code: 1
Executable `prettier` not found
it seems like prettier is installed correctly, but the symlink to it is not created:
$ find ~/.cache/pre-commit/ -name prettier.js
/home/rkm/.cache/pre-commit/repoes79dg4v/bin/prettier.js
$ ls -l $(find ~/.cache/pre-commit/ -name node_env-default)/bin
total 70376
-rwxr-xr-x. 1 rkm rkm 3702 Jun 17 17:30 activate
-rwxr-xr-x. 1 rkm rkm 3964 Jun 17 17:30 activate.fish
-rwxr-xr-x. 1 rkm rkm 72052312 Jun 2 14:33 node
lrwxrwxrwx. 1 rkm rkm 4 Jun 17 17:30 nodejs -> node
lrwxrwxrwx. 1 rkm rkm 38 Jun 17 17:30 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxrwxrwx. 1 rkm rkm 38 Jun 17 17:30 npx -> ../lib/node_modules/npm/bin/npx-cli.js
-rwxr-xr-x. 1 rkm rkm 355 Jun 17 17:30 shim
(doing the same in a docker container results in a prettier symlink being created there).
I suspect my VM may be borked somehow, but not sure how to debug this further. Any thoughts? Thanks!
The text was updated successfully, but these errors were encountered:
ok, so I did not have XDG_CACHE_HOME set and npm seemed to be getting confused (instead of defaulting this to ~/.cache like most other tools do). prettier now works after re-installing!
I'm not sure if we want to do any more debugging on how exactly this broke, but I'm happy to close. thanks again!
hello hello!
As discussed on discord, I'm having an issue running prettier via pre-commit:
it seems like prettier is installed correctly, but the symlink to it is not created:
(doing the same in a docker container results in a
prettier
symlink being created there).I suspect my VM may be borked somehow, but not sure how to debug this further. Any thoughts? Thanks!
The text was updated successfully, but these errors were encountered: