0

I tried following this but with no luck. http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

Every time I try to build it, it fails.

Does anyone have any ideas as to why does it fail to build. I am also using the latest version of Node if that helps.

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Yuchen Xu
  • 13
  • 2

1 Answers1

1

Thanks for your question. Just to clarify you are using the msnodesql driver right?

One of the reasons that you might not be able to build is because you are using the latest node version.

The Microsoft Node.js driver is not forward compatible. The next version is in the pipeline. In the meanwhile you will have to downgrade your node.js version to 0.8.9.

Additionally there are a few other requirements. Follow these steps and you should be good.

  • Node.js – Version 0.8.9 (32 bit version). Make sure you download the x86 version and not the x64 version. You might have to uninstall your current version and re-install this version to ensure compatibility.
  • Python 2.7.6.
  • 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.

Then just enter these in your node.js command prompt

1. npm install msnodesql
2. npm install -g node-gyp
3. node-gyp configure 
4. node-gyp build

You should now see a build folder inside msnodel.

Navigate to build > release. Copy the sqlserver.node file and paste it in the msnodesql > lib folder. Replace the old file if needed.

Now you can follow the rest of the instructions on the blog you mentioned which will help you with connection string and connecting to your db. Let me know if you are still stuck.

Thanks

meet-bhagdev
  • 2,608
  • 18
  • 22
  • So this seems to work. Thanks a lot!However I am not sure as to how can we make it work with latest node version. You says that the new version will be done soon. Can you tell me when – Yuchen Xu Apr 18 '15 at 00:05