Unable to download msnodesql-0.2.1-v0.10-x64.msi

前端 未结 4 1807
野性不改
野性不改 2021-01-12 12:03

I can\'t get msnodesql to install.

Originally I tried

npm install node-sqlserver

... and this warns that it has been superceded by

相关标签:
4条回答
  • 2021-01-12 12:35

    This worked to install from here:

    http://www.microsoft.com/en-us/download/details.aspx?id=29995

    ... not from npm:

    npm install msnodesql
    
    0 讨论(0)
  • 2021-01-12 12:38

    kernel's answer got me most of the way there. i had to perform a couple of additional steps to get it to work.

    config:

    • MS Server 2008 R2
    • node v0.10.29 32-bit
    • node-gyp v0.13.1
    • python v2.7.7
    • Visual Studio 2013 Express

    when i tried installing msnodesql per kernel's instructions:

    npm install C:\Users\foo\msnodesql
    

    ... i got compile errors.

    i made fixes based on what i read here: https://github.com/Azure/node-sqlserver/issues/168

    unfortunately, his 2nd code change didn't come through. here are all the changes i made:

    Operation.h, line 38, added cast to last argument:
    int result = uv_queue_work(uv_default_loop(), &operation->work, OnBackground, (uv_after_work_cb)OnForeground);
    
    stdafx.h, line 37, added #include to solve shared_ptr issues:
    #include <memory>
    

    after those changes, re-doing my npm install worked.

    0 讨论(0)
  • 2021-01-12 12:51

    This problem occurs because in the target packege in scripts/install.js there's invalid url to the driver. Actually on Microsoft Download you will find msnodesql-0.2.1-v0.8-x64.msi but not msnodesql-0.2.1-v0.10-x64.msi which is pointed in script. The only way to correct it is to install it from local drive.

    Download the Drive separately from http://www.microsoft.com/en-us/download/details.aspx?id=29995. Then I advise you the following:

    1. download from Git Hub (msnodesql) Zipped package. Unzip it to the local drive
    2. In the unzipped directory replace the contents of the

      scripts/install.js
      

      as the following:

      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 );
          }
      });
      

    Then just run

    npm install FULL_PATH_TO_UNZIPPED_PACKAGE_DIR
    

    The install process should not fail. And in you app's modules folder will be a

          msnodesql
    

    package. Then you should download (if you are not building by your self) the

    sqlserver.node
    

    from Git Hub (my reputation doesn't allow to post me link to it, so I'll reply with it if you need it) and place it to the

    lib folder of your msnodesql module directory. This should help you.

    0 讨论(0)
  • 2021-01-12 12:57

    Hello this works for me

    npm install msnodesqlv8 --save

    0 讨论(0)
提交回复
热议问题