【发布时间】:2014-10-22 06:25:57
【问题描述】:
我是 nodejs 和 heroku 的新手,我正在尝试部署我的第一个应用程序。
阅读了这篇Should I check in node_modules to git when creating a node.js app on Heroku? 的帖子后,似乎最好的做法是提交 node_modules 文件夹。
我的问题是我无法提交一些 node_modules,因为文件路径似乎太长,git 无法管理。有没有其他人有这个问题?我使用 SourceTree 作为我的 Git GUI 并运行 Windows 7。
我在 sourcetree 中得到的错误是:
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.js
fatal: 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
谢谢
【问题讨论】:
-
因此,为了尝试解决路径问题,我将整个 repo 进一步向上移动到根目录,我重新安装了我的模块,然后提交了一个全新的应用程序。提交似乎工作正常,一切都被推送到网上。但是,当我启动我的应用程序时,我得到“错误:找不到模块'Lodash._basebind”。
-
所以现在我正在检查并手动添加它说找不到的每个模块,每次我安装并提交一个新模块时,它都会说它找不到不同的模块。非常非常困惑。
标签: node.js git heroku atlassian-sourcetree