1

現在、Azure に Express/Node.js アプリをデプロイしようとしていますが、あまり成功していません。エラーは次のとおりです。

remote: > libxmljs@0.9.0 install D:\home\site\wwwroot\node_modules\libxmljs
remote: > node-gyp rebuild
remote: 
remote: 
remote: D:\home\site\wwwroot\node_modules\libxmljs>node "D:\Program Files (x86)\npm\1.3.11\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild 
remote: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
remote: MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere.  [D:\home\site\wwwroot\node_modules\libxmljs\build\binding.sln]
remote: gypnpm ERR! weird error 1
remote: Failed exitCode=1, command="D:\Program Files (x86)\nodejs\0.10.21\node.exe" "D:\Program Files (x86)\npm\1.3.11\node_modules\npm\bin\npm-cli.js" install --production
remote: An error has occurred during web site deployment.
remote: npm

Azure インスタンスが libxmljs のコンパイルに失敗していることを認識しているため、次のように .gitignore ファイルから libxmljs を除外しました。

!/node_modules/
/node_modules/*
!/node_modules/express/
!/node_modules/libxmljs/
.DS_Store
._*

しかし、それはまだまったく役に立ちません。Mac でコンパイルして Windows マシンにアップロードしようとしているからだと思います。誰か私に知恵を持っていますか?ありがとう!

4

1 に答える 1

1

.gitignore からすべての /node_modules/ を完全に削除しようとしましたか?

また、生成された .gitignore ファイルを使用している場合は、実際の「express」フォルダーが無視されているかどうかを確認してください。node.js アプリと Azure で継続的インテグレーションを行うには、Visual Studio で生成された .gitignore からそれを削除する必要がありました。

.gitignore のマッサージがまったく機能しない場合は、すべてのプロジェクト ファイルを手動でサーバーに FTP 送信して、起動するかどうかを確認してください。これにより、継続的インテグレーション/Git に問題があるのか​​、それとも実際のアプリと環境に問題があるのか​​がわかります。

編集: Azure への微妙な node.js の展開に関して、アプリのディレクトリ構造による問題も経験しました

于 2014-04-22T14:11:18.333 に答える