Installation problem - reference to sqlserver.node in sql.js #51

Closed
rkrol opened this Issue Aug 2, 2012 · 8 comments

4 participants

@rkrol

Hi,

I just compiled/installed node-sqlserver module on node 0.8.4.
When install done and try to use it in my app, I have this error message :

module.js:340
    throw err;
        ^
Error: Cannot find module './sqlserver.node'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object. (C:\workspace\transaction-manager\node_modules\node-sqlserver\lib\sql.js:20:11)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)

It seems that the path to sqlserver.node is wrong in sql.js.
It works if I replace the line 20 in by :

var sql = require('../build/RELEASE/sqlserver.node');

Rudy

@wread

Thanks for the feedback. You're correct. The way the paths are set up you'll need to manually copy sqlserver.node to the 'lib' folder after you build it. For conveneince, you may want to create a simple batch file that builds and then copies the files to the lib folder for you.
-OR-
Alternatively, you can change the path as you've done. The problem with this method is that you'll have different paths for 'debug' vs. 'release' compilations.

@jkint

Did you clone/pull from the master branch or the develop branch? I think this issue has been fixed in the develop branch.

@rkrol

Thanks for your help.
I cloned from master branch, I'll try develop next time.

@jguerin

This should be fixed in the develop branch. Could you please take a look and let us know if it is?

@rkrol

I tried with develop branch and I have the same issue. I did it on the same windows instance, so I'm not sure if I retrieve master or develop version on npm install because they have the same version number (0.1.0). What do I have to clean to be sure using the develop branch ?

@jguerin

Please use this:

npm install https://github.com/WindowsAzure/node-sqlserver/tarball/develop
@rkrol

That works on develop branch, thanks!

@jguerin jguerin was assigned Aug 9, 2012
@jguerin

Awesome :)

@jguerin jguerin closed this Aug 9, 2012
@jguerin jguerin was unassigned by rkrol Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment