WebReflection / dblite

sqlite for node.js without gyp problems
MIT License
209 stars 34 forks source link

dblite installation broken (npm) #14

Closed mik977 closed 11 years ago

mik977 commented 11 years ago

This is the folder structure I get after issuing the command:

npm install dblite

...

node_modules/ dblite/ benchmark/ dblite.js sqlite3.js LICENSE.txt package.json README.md

missing subfolder: build

this however, works as expected: npm install git://github.com/WebReflection/dblite.git

I tried several times in different folders.

WebReflection commented 11 years ago

have you tried with npm install -g dblite ?

WebReflection commented 11 years ago

I've just double checked and I have a proper folder structure ...

LICENSE.txt
README.md
benchmark
build
package.json

while benchmark could be removed without problems can you tell me which version of dblite are you trying to install or which version of node and npm are you using?

dblite@0.3.8

is what I have now

mik977 commented 11 years ago

Hmmm... I found out that on one computer the installation worked as it should, Only on my work computer (Linux Mint) it doesn't (the "build" subfolder is missing). There are no errors reported.

I am issuing the following command to the shell:

npm install dblite

On both computers node is at the most current stable version: 0.10.21 I guess it's some strange thing going on on my other computer at work. Since the installation is working with:

npm install git://github.com/WebReflection/dblite.git

I wonder if it's worth spending time on this.

THANK YOU for your time and for sharing!

WebReflection commented 11 years ago

I wonder how can I solve a problem only your computer at work has ... :D have you tried npm uninstall dblite and then npm install -g dblite ? which version of npm do you have ? npm --version is this the same of the other computer? It looks like npm in Mint is getting a very old version of dblite, probably the first push.

mik977 commented 11 years ago

Now that's interesting. I've tried today on the computer that caused me troubles yesterday and worked perfectly. What I noticed is that yesterday the second line below was missing and the installation completed faster. So it might be that the connection to the npm registry somehow ended prematurely.

npm http GET https://registry.npmjs.org/dblite npm http 304 https://registry.npmjs.org/dblite

Problem solved. I can close this (no)issue now :). Sorry for bothering you.

WebReflection commented 11 years ago

it's OK, I just got worried I would never have been able to solve your problem :D

mik977 commented 11 years ago

Since we are on line, I have another question for you. Why do you handle errors this way. Wouldn't it be better to have callbacks as the last parameter as is nodejs standard practice - function(err, res)? This way one could take actions when errors happen. By the way I am by no means an expert so I might be missing something.

Bye, Miha

On 22. 10. 2013 08:07, Andrea Giammarchi wrote:

it's OK, I just got worried I would never have been able to solve your problem :D

— Reply to this email directly or view it on GitHub https://github.com/WebReflection/dblite/issues/14#issuecomment-26779259.

WebReflection commented 11 years ago

you are the second one asking me that ... I don't know, maybe that's the right way to go for node. It's just so boring to me to always write that first argument I hope I'll never encounter :D ... dblite is good as it is so probably next major release version update will change everything and force every current user to go for callbacks? maybe it will be that smart to do a smooth transition meanwhile ? .. or maybe that's not needed, since real world code suppose to have "no errors" and that variable is for debugging purpose only as it has always been in node where code usually looks like if(err) return console.err(err); and that's it? considering it, might do that soon ;-) stay tuned

WebReflection commented 11 years ago

FYI, version 0.4.0 has the err variable. Callbacks there work either with a single argument, or double.

function (rows) {} will keep working as expected for now

function (err, rows) {} will receive the error buffer if returned, null otherwise.

mik977 commented 11 years ago

On 24.10.2013 22:52, Andrea Giammarchi wrote:

FYI, version |0.4.0| has the err variable. Callbacks there work either with a single argument, or double.

|function (rows) {}| will keep working as expected for now

|function (err, rows) {}| will receive the error buffer if returned, null otherwise.

— Reply to this email directly or view it on GitHub https://github.com/WebReflection/dblite/issues/14#issuecomment-27028796.

OK, bravo! We say that "you killed two flies with one stroke". Thank you for "fixing" dblite. By the way, I didn't know that function.length gives the number of formal arguments... very useful ... I am always learning. Javascript is really wonderful ... always something new to learn.

Grazie e stammi bene...

Miha Kralj LiNK d.o.o. Nova Gorica Partizanska ulica 49 5000 Nova Gorica Slovenija