我目前正在尝试在 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 机器。有人对我有什么智慧吗?谢谢!