首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Node_modules路径损坏,无法在GIT上提交

Node_modules路径损坏,无法在GIT上提交
EN

Stack Overflow用户
提问于 2014-05-27 17:30:10
回答 1查看 257关注 0票数 0

我正在尝试保留node_modules中所有组件的一个git版本。我刚刚从.gitignore中删除了node_modules文件夹,我本希望在得到以下信息之前可以毫不费力地同步:

代码语言:javascript
复制
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/package.json.
The file will have its original line endings in your working directory.
fatal: unable to stat 'node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle/node_modules/bin-wrapper/node_modules/download/node_modules/decompress/node_modules/adm-zip/test/assets/attributes_test/New folder/hidden.txt': No such file or directory

Git在此文件上崩溃,找不到该文件。

当我使用资源管理器时,在路径上有一个错误:

代码语言:javascript
复制
 node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle/node_modules/bin-wrapper

代码语言:javascript
复制
 node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle/node_modules.bin-wrapper

有没有一种正确的方法可以在不破坏依赖的情况下推入git?

EN

回答 1

Stack Overflow用户

发布于 2014-05-27 18:48:02

如您所见,该文件是adm-zip包测试套件的一部分。从它的名称(attributes_test/New folder/hidden.txt)可以看出,这个文件有些特殊,可能会表现出奇怪的行为(我认为这种行为的一部分已经过测试)。因为git不能处理这样的文件,所以你能做的最好的事情就是显式地把它添加到.gitignore中。对于其他文件或包,您不太可能遇到这样的问题。

顺便说一句,将node_modules包含到存储库中是已部署应用程序(即非库)的标准实践。例如,https://github.com/npm/npm-www

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23885804

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档