npm ERR!运行npm install时enoent undefined [英] npm ERR! enoent undefined when running npm install
问题描述
我曾经在Windows 7 pc中运行Angular项目.我安装了Windows 2016和所有neceserry工具.由于我没有备份node_modules文件夹,因此我需要安装必要的依赖项才能运行我的角度项目.当我运行命令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
我在Google上寻找解决方案,并添加了Windows路径变量%APPDATA%\npm
,但是它不起作用.奇怪的是,我没有在项目中使用FileSaver.js.如何使npm install
正常工作?
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?
推荐答案
此问题是由于未安装Git或终端中不可用而引起的.赠送的是您的错误日志中的这一行:
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
基本上,这意味着命令git
由于找不到而无法执行.
Basically this means that the command git
could not be executed because it was not found.
在再次运行此命令之前,请确保已安装git并将其添加到您的PATH中.
Make sure git is installed and added to your PATH before running this command again.
这篇关于npm ERR!运行npm install时enoent undefined的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!