spo*_*jam 7 node.js iisnode node-sqlserver
我无法安装msnodesql.
本来我试过
npm install node-sqlserver
Run Code Online (Sandbox Code Playgroud)
...并且这警告它已被msnodesql取代.
我成功安装了Node.js,iisnode,我看到样本Hello.js正在服务(yayee,很棒),所以至少node和iisnode正在工作.
我安装了先决条件:
Node.js - use the latest version if possible, but it has been tested on node 0.6.10 and later
node-gyp - latest version installed globally (npm install -g node-gyp)
python 2.7.x - for node-gyp (make sure it is in the path)
Visual C++ 2010 - the Express edition is freely available from Microsoft
SQL Server Native Client 11.0 - available as Microsoft SQL Server 2012 Native Client found in the SQL Server 2012 Feature Pack
Run Code Online (Sandbox Code Playgroud)
......当我跑这个时,我得到:
npm install msnodesql
npm http GET https://registry.npmjs.org/msnodesql
npm http 304 https://registry.npmjs.org/msnodesql
> msnodesql@0.2.1 install c:\nodejs\node_modules\msnodesql
> node scripts/install.js
You are downloading Microsoft Driver for Node.js for SQL Server from
Microsoft, the license agreement to which is available at
http://download.microsoft.com/download/6/E/2/6E2D7972-E54D-45AA-
8AB6-41E616035147/EULA.rtf and in the project folder to which the
software is downloaded. Check the package for additional dependencies, which
may come with their own license agreement(s). Your use of the package and
dependencies constitutes your acceptance of their license agreements. If
you do not accept the license agreement(s), then delete the relevant
components from your device.
install.js: Unable to download msnodesql-0.2.1-v0.10-x64.msi
npm ERR! weird error 1
npm ERR! not ok code 0
Run Code Online (Sandbox Code Playgroud)
我用许可证密钥注册了C++,所以有人可以告诉我这里缺少什么吗?
请原谅这里的菜鸟问题,但我不得不问,我如何"检查软件包是否存在其他依赖关系"?究竟是指什么?
ker*_*nel 11
出现此问题的原因是在scripts/install.js中的目标packege中,驱动程序的URL无效.实际上在Microsoft下载中,您将找到msnodesql-0.2.1-v0.8-x64.msi,但不会找到脚本中指向的msnodesql-0.2.1-v0.10-x64.msi.纠正它的唯一方法是从本地驱动器安装它.
从http://www.microsoft.com/en-us/download/details.aspx?id=29995单独下载该驱动器.然后我建议你:
在解压缩的目录中替换的内容
scripts/install.js
Run Code Online (Sandbox Code Playgroud)
如下:
var assert=require('assert');
var subprocess=require('child_process');
var package=require('../package.json');
function log( msg ) {
console.log( "install.js: " + msg );
}
console.log( "You are installing driver locally." );
var msiName = 'HERE_IS_THE_PATH_TO_YOUR_DOWNLOADED_DRIVER\\msnodesql-0.2.1-v0.8-x64.msi';
// run the msi to extract the driver inside
var msiCmd = [ 'cmd', '/c', 'msiexec', '/i', msiName, '/quiet','IACCEPTMSNODESQLLICENSETERMS=Yes', 'NPMINSTALL=Yes' ].join(' ');
subprocess.exec( msiCmd, function( error, stdout, stderr ) {
if( error !== null ) {
log( error );
log( stdout );
process.exit( 1 );
}
});
Run Code Online (Sandbox Code Playgroud)然后跑吧
npm install FULL_PATH_TO_UNZIPPED_PACKAGE_DIR
Run Code Online (Sandbox Code Playgroud)
安装过程不应该失败.在你的应用程序的模块文件夹将是一个
msnodesql
Run Code Online (Sandbox Code Playgroud)
包.然后你应该下载(如果你不是自己建立)
sqlserver.node
Run Code Online (Sandbox Code Playgroud)
来自Git Hub(我的声誉不允许发布链接到它,所以如果你需要它我会回复它)并把它放到
msnodesql模块目录的lib文件夹.这应该对你有帮助.
| 归档时间: |
|
| 查看次数: |
5221 次 |
| 最近记录: |