Cannot git commit due to prettier errors #19942
-
Operating SystemLinux RAM size16 GB Which step are you stuck on?
Error LogRunning prettier ...
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
❯ package.json — 600 files (chunk 1/5)...
❯ **/* — 600 files
✖ prettier --write --ignore-unknown [ENOENT]
❯ package.json — 600 files (chunk 2/5)...
❯ **/* — 600 files
✖ prettier --write --ignore-unknown [ENOENT]
❯ package.json — 600 files (chunk 3/5)...
❯ **/* — 600 files
✖ prettier --write --ignore-unknown [ENOENT]
❯ package.json — 600 files (chunk 4/5)...
❯ **/* — 600 files
✖ prettier --write --ignore-unknown [ENOENT]
❯ package.json — 599 files (chunk 5/5)...
❯ **/* — 599 files
✖ prettier --write --ignore-unknown [ENOENT]
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ prettier --write --ignore-unknown failed without output (ENOENT).
✖ prettier --write --ignore-unknown failed without output (ENOENT).
✖ prettier --write --ignore-unknown failed without output (ENOENT).
✖ prettier --write --ignore-unknown failed without output (ENOENT).
✖ prettier --write --ignore-unknown failed without output (ENOENT).
Traceback (most recent call last):
File ".git/hooks/pre-commit", line 254, in <module>
main()
File ".git/hooks/pre-commit", line 246, in main
run_prettier()
File ".git/hooks/pre-commit", line 212, in run_prettier
subprocess.run('npx lint-staged', shell=True, check=True)
File "/home/enyu/.pyenv/versions/3.8.15/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'npx lint-staged' returned non-zero exit status 1. Approaches already used to resolve the issueI tried to run
Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 12 replies
-
@nikitaevg PTAL. |
Beta Was this translation helpful? Give feedback.
-
@StephenYu2018 can you run |
Beta Was this translation helpful? Give feedback.
-
I am also facing the same error, I tried running the ✔ Preparing lint-staged... ✖ prettier --write --ignore-unknown failed without output (ENOENT). |
Beta Was this translation helpful? Give feedback.
-
@nikitaevg, upon running |
Beta Was this translation helpful? Give feedback.
-
I am getting the same error. When I check node -v I get "Command 'node' not found" Also, for some reason I do not have npm installed either. |
Beta Was this translation helpful? Give feedback.
-
@Helper2020, go to oppia_tools directory and install node and npm if not already installed and then follow the above steps. This worked for me. Also install node version 18 or higher. |
Beta Was this translation helpful? Give feedback.
@StephenYu2018 can you run
node -v
and check which nodejs version you have? If it's something like 12.x.x then try upgrading it to 18 or 20.