节点项目失败的Azure git部署

问题描述:

我试图将我的项目部署到天蓝。这是失败的。这些是我采取的步骤。节点项目失败的Azure git部署

git init 
git config core.longpaths true 
git add . 
git commit -m "initial commit" 

所有的工作。我将git配置为接受长路径,因为我需要chokidar,并且chokidar有一些深层嵌套的依赖关系,最大限度地超出了git的字符限制。然后,我转到azure,创建一个新的Web应用程序,选择自定义,从本地git存储库进行部署,将远程仓库添加到本地git。一切正常。但是,当我运行git push azure master,我得到这个错误:

remote: Updating branch 'master'. 
remote: Deployment failed 
remote: Error - Changes committed to remote repository but deployment to website failed. 

所以我去了一个空目录,使长的路径,并克隆回购。它给了我这个错误:

remote: warning: unable to access 'node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/regex-cache/node_modules/benchmarked/node_modules/file-reader/node_modules/map-files/node_modules/globby/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/.gitattributes': Filename too long 
remote: Counting objects: 5183, done. 
remote: Compressing objects: 100% (3893/3893), done. 
remote: Total 5183 (delta 489), reused 5183 (delta 489) 
Receiving objects: 100% (5183/5183), 4.05 MiB | 1.51 MiB/s, done. 
Resolving deltas: 100% (489/489), done. 
Checking connectivity... done. 
fatal: cannot create directory at 'node_modules/chokidar/node_modules/anymatch/node_modules/micromatch/node_modules/regex-cache/node_modules/benchmarked/node_modules/file-reader/node_modules/map-files/node_modules/globby/node_modules/array-union/node_modules/array-uniq': Filename too long 
warning: Clone succeeded, but checkout failed. 
You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD' 

有像上面的第一个更多的错误。所以我认为Git Azure在其服务器上运行时未配置为接受长文件路径?我可以从版本控制中删除node_modules并配置azure下载它们吗?

你是正确的

  1. 添加/ node_modules到的.gitignore。
  2. 为您的packages.json添加依赖关系,并让Azure在部署时安装它们(每个新/更新程序包只能一次性安装)。

PS:由于您已将/ node_modules文件夹推送到版本控制,因此您必须先将其删除。

+0

谢谢,这工作。但是没有办法使用git将长文件名的文件推送到Azure中? – 2015-04-05 21:08:13

+0

可能与git无关。这是使用windows api时ntfs文件系统的限制。 https://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath – 2015-04-05 23:05:02