我正在尝试保留node_modules中所有组件的一个git版本。我刚刚从.gitignore中删除了node_modules文件夹,我本希望在得到以下信息之前可以毫不费力地同步:
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 directoryGit在此文件上崩溃,找不到该文件。
当我使用资源管理器时,在路径上有一个错误:
node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle/node_modules/bin-wrapper至
node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/gifsicle/node_modules.bin-wrapper有没有一种正确的方法可以在不破坏依赖的情况下推入git?
发布于 2014-05-27 18:48:02
如您所见,该文件是adm-zip包测试套件的一部分。从它的名称(attributes_test/New folder/hidden.txt)可以看出,这个文件有些特殊,可能会表现出奇怪的行为(我认为这种行为的一部分已经过测试)。因为git不能处理这样的文件,所以你能做的最好的事情就是显式地把它添加到.gitignore中。对于其他文件或包,您不太可能遇到这样的问题。
顺便说一句,将node_modules包含到存储库中是已部署应用程序(即非库)的标准实践。例如,https://github.com/npm/npm-www
https://stackoverflow.com/questions/23885804
复制相似问题