TryGhost / node-sqlite3

SQLite3 bindings for Node.js
BSD 3-Clause "New" or "Revised" License
6.14k stars 808 forks source link

Not able to install sqlite NPM on my windows xp machine. #51

Closed vmrathod closed 11 years ago

vmrathod commented 12 years ago

Hello, can somebody tell me how to install "sqlite NPM" on my windows xp machine? What are the pre-requirements for this installation?

Thanks Vishal Rathod

kkaefer commented 12 years ago

Please describe what you did so far, otherwise I can't know where you are stuck. Commands you executed, how you installed node, any error messages you see.

The general way of installing sqlite3 is (after having installed node) to type npm install sqlite3.

vmrathod commented 12 years ago

Yes, i am running "npm install sqlite3" command but i am getting below error.

'node-waf' is not recognized as an internal or external command, operable program or batch file. 'true' is not recognized as an internal or external command, operable program or batch file. npm ERR! error installing sqlite3@2.1.1 Error: sqlite3@2.1.1 preinstall: node-w af clean || true; node-waf configure build npm ERR! error installing sqlite3@2.1.1 cmd "/c" "node-waf clean || true; node- waf configure build" failed with 1 npm ERR! error installing sqlite3@2.1.1 at ChildProcess. (C:\node \bin\node_modules\npm\lib\utils\exec.js:49:20) npm ERR! error installing sqlite3@2.1.1 at ChildProcess.emit (events.js:70:1 7) npm ERR! error installing sqlite3@2.1.1 at maybeExit (child_process.js:359:1 6) npm ERR! error installing sqlite3@2.1.1 at Process.onexit (child_process.js: 395:5) npm ERR! sqlite3@2.1.1 preinstall: node-waf clean || true; node-waf configure b uild npm ERR! cmd "/c" "node-waf clean || true; node-waf configure build" failed wi th 1 npm ERR! npm ERR! Failed at the sqlite3@2.1.1 preinstall script. npm ERR! This is most likely a problem with the sqlite3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-waf clean || true; node-waf configure build npm ERR! You can get their info via: npm ERR! npm owner ls sqlite3 npm ERR! There is likely additional logging output above. npm ERR! npm ERR! System Windows_NT 5.1.2600 npm ERR! command "C:\node\bin\node.exe" "C:\node\bin\node_modules\npm\ bin\npm-cli.js" "install" "sqlite3" npm ERR! cwd C:\node\chap06 npm ERR! node -v v0.6.0 npm ERR! npm -v 1.0.106 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\node\chap06\npm-debug.log npm not ok

rinie commented 12 years ago

Should it work on Windows ? (Tried windows 7). Node 0.6.4 via MSI installer with NPM. npm install sqlite3

node-waf niet verwacht op dit moment. npm ERR! error installing sqlite3@2.1.1 Error: sqlite3@2.1.1 preinstall: node-waf clean || (exit 0); node-waf configure build npm ERR! error installing sqlite3@2.1.1 cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1 npm ERR! error installing sqlite3@2.1.1 at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\exec.js:49:20) npm ERR! error installing sqlite3@2.1.1 at ChildProcess.emit (events.js:70:17) npm ERR! error installing sqlite3@2.1.1 at maybeExit (child_process.js:359:16) npm ERR! error installing sqlite3@2.1.1 at Process.onexit (child_process.js:395:5) npm ERR! sqlite3@2.1.1 preinstall: node-waf clean || (exit 0); node-waf configure build npm ERR! cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1 npm ERR! npm ERR! Failed at the sqlite3@2.1.1 preinstall script. npm ERR! This is most likely a problem with the sqlite3 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-waf clean || (exit 0); node-waf configure build npm ERR! You can get their info via: npm ERR! npm owner ls sqlite3 npm ERR! There is likely additional logging output above. npm ERR! npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "sqlite3" npm ERR! cwd C:\temp npm ERR! node -v v0.6.4 npm ERR! npm -v 1.1.0-alpha-6 npm ERR! code ELIFECYCLE npm ERR! message sqlite3@2.1.1 preinstall: node-waf clean || (exit 0); node-waf configure build npm ERR! message cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\temp\npm-debug.log npm not ok

kkaefer commented 12 years ago

Installing compiled node extensions (like node-sqlite3) is currently not supported on Windows.

Nick55 commented 12 years ago

Hello

I've loaded node.js successfully onto my Windows 7 machine using the WIndows installer node-v0.6.10.msi.

I've been able to run npm ok to add a couple of modules (formidable and ejs) but get the same problem as both the guys above when trying "npm install sqlite3"

In your response, kkaefer, you say that "installing compiled node extensions is currently not supported in Windows". Does this just mean it's completely impossible to use the sqlite3 extension on Windows and there's no alternative way round it?

If that is the case, is anyone aware of any sqlite3 extension for node.js which can be used in the Windows environment?

Thanks.

Just for completeness, error messages from npm follow:

node-waf was unexpected at this time. npm ERR! error installing sqlite3@2.1.1

npm ERR! sqlite3@2.1.1 preinstall: node-waf clean || (exit 0); node-waf configure build npm ERR! cmd "/c" "node-waf clean || (exit 0); node-waf configure build" failed with 1 npm ERR! npm ERR! Failed at the sqlite3@2.1.1 preinstall script. npm ERR! This is most likely a problem with the sqlite3 package, npm ERR! not with npm itself.

kkaefer commented 12 years ago

@Nick55: with "installing compiled node extensions not being supported", I mean that there is no officially sanctioned way of doing this; it's on the roadmap for node 0.8. #61 brings us closer to this goal, so if you want to get started using node-sqlite3 on Windows, check out this pull request and compile it manually. Please note that to compile node-sqlite3, you have to have a node development environment set up on your computer. For details, see https://github.com/developmentseed/node-sqlite3/wiki/Building-On-Windows

Nick55 commented 12 years ago

@kkaefer : thanks for your comments. It's a while since I've used Visual Studio and my version is 6.0 rather than 2010 which is what I think will be needed to compile stuff myself. I guess I'll just have to wait until node 0.8 makes it easy for me.

It is a bit of a puzzle though, as Chrome on the browser side already has an API for sqlite built into it (openDatabase and executeSQL work out of the box, for example). In my naivety, I assumed that as node.js uses the same V8 engine it would have access to the same functions.

kkaefer commented 12 years ago

@Nick55: node only uses the V8 interpreter and does not have all the Web/DOM APIs built-in. Also note that node-sqlite3's API is quite different from Chrome's database API.

Nick55 commented 12 years ago

OK, understood. This is all a bit new to me as for the last couple of years I've been happily using the Mozilla mozIStorageService with serverside javascript. Sadly the excellent web server which I've been using (a Firefox extension called POW) is no longer supported so I need to find something else. I don't want to rewrite all my serverside javascript as php, it would take months, so an obvious apache/php/sqlite setup doesn't appeal. Node.js looks a good solution but perhaps isn't quite there yet for a Windows environment. Maybe it's time to fire up one of my old machines with ubuntu.

cmundi commented 12 years ago

@Nick55: You can download the Visual Studio 2010 Express edition from Microsoft. This works fine: node-gyp just uses the msbuild toolchain. This is how I'm building and using node-sqlite3. It's crazy easy. Be sure to pull the "gyp" branch of node-sqlite3 from TooTallNate's pull request. Hopefully this makes it into the master branch of node-sqlite3 branch really soon (and then the Windows branch can go away, I think). Windows support for node is rapidly closing the gap, thanks to a broadly based effort by both the core and module devs.

Nick55 commented 12 years ago

@cmundi : Thanks for your post, I didn't know about VS Express. I downloaded it but was struggled with the simple stuff - I've never used it before to compile C++ code, only for development in VB and ASP, so I've reverted to an old machine running ubuntu where node.js has loaded like a dream and after one glitch caused by loading the wrong npm, node-sqlite3 is now up and running. I can revert to Windows when everything's available in the master branch.

cmundi commented 12 years ago

I'm glad that helped and most importantly that you're getting stuff done. On Feb 22, 2012 3:25 AM, "Nick55" < reply@reply.github.com> wrote:

@cmundi : Thanks for your post, I didn't know about VS Express. I downloaded it but was struggled with the simple stuff - I've never used it before to compile C++ code, only for development in VB and ASP, so I've reverted to an old machine running ubuntu where node.js has loaded like a dream and after one glitch caused by loading the wrong npm, node-sqlite3 is now up and running. I can revert to Windows when everything's available in the master branch.


Reply to this email directly or view it on GitHub:

https://github.com/developmentseed/node-sqlite3/issues/51#issuecomment-4101427

springmeyer commented 11 years ago

https://github.com/developmentseed/node-sqlite3/wiki/Building-On-Windows