node.jsangularnpm-install

npm ERR! enoent undefined when running npm install


I used to run my Angular project in my windows 7 pc. I installed Windows 2016 and all neceserry tools. I need to install the necessary dependencies for my angular project to run since I did not backup my node_modules folder. When I run the command npm install I get the following error:

C:\Angular_Prj>npm install
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-07-11T09_48_53_918Z-debug.log

I looked for solution on google added the Windows path variable %APPDATA%\npm but it did not work. The strange thing is I do not use FileSaver.js in my project. How can I make npm install to work?


Solution

  • This issue is caused because Git is either not installed or not available in a terminal. The give away is this line in your error log:

    npm ERR! enoent spawn git ENOENT
    

    Basically this means that the command git could not be executed because it was not found.

    Make sure git is installed and added to your PATH before running this command again.