Showing 1 – 3 of 3 replies
mingbao

Issue with npm Installation - Unknown Git Error

mingbao
5 months ago
I am writing to seek assistance regarding an issue I encountered while trying to install dependencies using npm.

During the installation process, I encountered the following error:

4919 timing command:install Completed in 594132ms
4920 verbose stack Error: An unknown git error occurred
4920 verbose stack at makeError (/Users/***/.nvm/versions/node/v18.14.1/lib/node_modules/npm/node_modules/@npmcli/git/lib/make-error.js:28:13)
4920 verbose stack at /Users/***/.nvm/versions/node/v18.14.1/lib/node_modules/npm/node_modules/@npmcli/git/lib/spawn.js:37:26
4920 verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
4921 verbose cwd /Users/baoming/Documents/tdfz/code/PBMS/angularjsweb/master
4922 verbose Darwin 23.1.0
4923 verbose node v18.14.1
4924 verbose npm v9.3.1
4925 error code ENOENT
4926 error syscall spawn https://github.com/
4927 error path https://github.com/
4928 error errno -2
4929 error enoent An unknown git error occurred
4930 error enoent This is related to npm not being able to find a file.
4930 error enoent
4931 verbose exit -2
4932 timing npm Completed in 594154ms
4933 verbose unfinished npm timer reify 1700724971866
4934 verbose unfinished npm timer reify:loadTrees 1700724971867

I am uncertain about the cause of this error and how to resolve it. I have tried clearing the npm cache and ensuring a stable internet connection, but the error persists.

I kindly request your guidance and support in resolving this matter. Any step-by-step instructions or suggestions would be greatly appreciated.

Thank you very much for your attention and assistance. I look forward to hearing from you soon.
themicon
themicon SELLER
5 months ago
Hello,

The error seems like git is not installed or not present in PATH variable. Or for some other reason npm can't find the git executable.
You can validate with the command :

git --version

Hope this helps
Regards
mingbao
mingbao
5 months ago
I. sure i installed the git

git version 2.39.3 (Apple Git-145)
themicon
themicon SELLER
5 months ago
Also noted that your are on node v18.14.1 and the last version supported is v14. It could work but the template was not tested with node 18 and some dependencies may trigger issues. I suggest you to use nvm to manage node version and run the project with v14 (unless your are doing the upgrade)

Regarding git issue, the error message in the node log point to an issue with a missing git command.

Last edited 5 months ago