Node.js Azure git部署节点项目失败

Node.js Azure git部署节点项目失败,node.js,git,azure,Node.js,Git,Azure,我正在尝试将我的项目部署到azure。它正在失败。这些是我采取的步骤 git init git config core.longpaths true git add . git commit -m "initial commit" 所有这些都有效。我将git配置为接受长路径,因为我需要chokidar,而chokidar有一些深度嵌套的依赖项,如果没有这些依赖项,它们将最大限度地超出git的字符限制。然后我转到azure,创建一个新的web应用程序,选择custom,从本地git存储库部署,将

我正在尝试将我的项目部署到azure。它正在失败。这些是我采取的步骤

git init
git config core.longpaths true
git add .
git commit -m "initial commit"
所有这些都有效。我将git配置为接受长路径,因为我需要chokidar,而chokidar有一些深度嵌套的依赖项,如果没有这些依赖项,它们将最大限度地超出git的字符限制。然后我转到azure,创建一个新的web应用程序,选择custom,从本地git存储库部署,将远程repo添加到本地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'
因此,我转到一个空目录,启用长路径,并克隆了repo。它给了我这个错误:

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在他们的服务器上运行,没有配置为接受长文件路径?我可以从版本控制中删除节点模块并配置azure下载它们吗?

你是对的

  • 将/node_模块添加到.gitignore
  • 将依赖项添加到您的packages.json中,并让Azure在部署时安装它们(每个新的/更新的包只需一次性安装)

  • PS:既然您已经将/node_modules文件夹推到了版本控制中,您必须先将其删除。

    谢谢,这很有效。但是没有办法使用git将文件名较长的文件推送到Azure?可能与git无关。这是使用windows api时ntfs文件系统的一个限制。