我是nodejs和heroku的新手,我正在尝试部署我的第一个应用程序。
在阅读了这篇文章之后,modules to git when creating a node.js app on Heroku?似乎是提交node_modules文件夹的最佳实践。
我的问题是,我不能提交一些node_modules,因为文件路径似乎太长,无法管理git。还有其他人有这个问题吗?我使用SourceTree作为我的Git并运行windows 7。
我在源树中遇到的错误是:
git -c diff.mnemonicprefix=false -c core.quotepath=false rm -q -f -- node_modules/gulp-concat/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/node_modules/lodash._htmlescapes/index.jsfatal: pathspec 'node_modules/gulp-concat/node_modules/gulp-util/node_modules/lodash.template/node_modules/lodash.escape/node_modules/lodash._escapehtmlchar/node_modules/lodash._htmlescapes/index.js' did not match any files
谢谢
发布于 2014-08-28 12:02:31
与文章相反,我建议不要将node_modules提交到存储库中。
原因:
如果您担心部署到heroku的速度,不要担心。Heroku缓存您使用的所有模块,并只更新更改。
无论哪种方式,您得到的错误都不是因为文件名太长。这要么是因为您试图对未跟踪的文件执行一些操作。或者已经不存在的跟踪文件上。
https://stackoverflow.com/questions/25547990
复制相似问题