我想使用我的Azure托管站点设置msnodesql(以前称为node-sqlserver),并且遇到了一些问题。Azure NPM问题:msnodesql无法部署
本质上,我在Azure中发生部署失败。我相信这是由于NPM试图在服务器上安装msnodesql的事实,但会失败,因为它需要安装Python和C++ 2010的“node-gyp”(这在azure方面不存在)。这里是我看到的错误消息
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the msnodesql package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls msnodesql
npm ERR! There is likely additional logging output above.
我一直在黑客这个错误一段时间,似乎没有什么解决它。我得到的最佳答案是手动在node_modules中包含msnodesql(如由http://geekswithblogs.net/shaunxu/archive/2012/11/16/install-npm-packages-automatically-for-node.js-on-windows-azure-web.aspx指定)。我觉得这应该解决它,但可惜它没有。我也试着针对本地x86节点编译它,并且只使用预编译的x86(由http://geekswithblogs.net/shaunxu/archive/2012/09/18/node.js-adventure---when-node.js-meets-windows-azure.aspx建议)。
这里有任何其他的建议。
另外值得注意的是,它在我的本地环境中工作得很好,可以使用运行在webmatrix内但运行Azure SQL数据库的msnodesql从我创建的SQL Azure数据库中获取数据(一旦我将IP列入白名单)。
我原来在DB和Azure的网站在不同地区有问题,但我纠正了这个问题。
有道理。我想我以前是在走另一条路线。我觉得没有在package.json部分中,但我想如何让它包含在我的环境中。很高兴知道这是遵循的路线,非常确定这将解决我的问题。 –
我想我不能在我的package.json中配置一些东西。它仍然尝试在NPM中进行部署,但是我没有将它包含在我的package.json中,而只是在我的node_modules中为我的站点提供了msnodesql文件夹。 –
这是我的package.json:'{ “名”: “LISN”, “版本”: “0.1.0”, “主”: “./server.js”, “依赖”:{ “表达“: ”*“, ”玉“: ”〜0.22.0“ }, ”引擎“:{ ”节点“: ”> = 0.6.14“ } }' –