【发布时间】:2019-11-21 01:58:14
【问题描述】:
我曾经在我的 Windows 7 电脑上运行我的 Angular 项目。我安装了 Windows 2016 和所有需要的工具。由于我没有备份我的 node_modules 文件夹,因此我需要为我的 Angular 项目安装必要的依赖项才能运行。当我运行命令npm install 时,出现以下错误:
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
我在谷歌上寻找解决方案添加了 Windows 路径变量%APPDATA%\npm,但它不起作用。奇怪的是我没有在我的项目中使用 FileSaver.js。我怎样才能让npm install 工作?
【问题讨论】:
-
你是否安装了 git 并在终端中可用?
-
显然它在终端中不可用。我必须添加路径
C:\Program Files\Git才能使其工作。太感谢了。如果您写的是答案而不是评论,我可以将其标记为已接受的答案。 -
很高兴听到它已解决。我已经添加了答案。
标签: node.js angular npm-install