Intallation sqlite für node.js unter Windows

Kaum macht man's richtig, schon klappt es.

Zwischenzeitlich habe ich zig Tipps gelesen und mir Python 2.7 und MS VC++ 2010 Express installiert. Bei letzterem hat es mir dann sauber den Windows-Installer zerfetzt - es ging nichts mehr.
Nun, mit neuem Windows-Installer, bin ich wieder da, wo ich heute Morgen schon war.

Und zwar bei diesem Tipp von TooTallNate, der Gold wert ist:

Code:
# update npm
$ npm install -g npm

# install sqlite3, my gyp branch
$ npm install https://github.com/TooTallNate/node-sqlite3/tarball/gyp

Testscript erstellt
Code:
var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');

db.serialize(function() {
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
      stmt.run("Ipsum " + i);
  }
  stmt.finalize();

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
      console.log(row.id + ": " + row.info);
  });
});

db.close();

zupp, kommt direkt die gute Laune zurück:

Code:
C:\Programme\nodejs>node test.js
1: Ipsum 0
2: Ipsum 1
3: Ipsum 2
4: Ipsum 3
5: Ipsum 4
6: Ipsum 5
7: Ipsum 6
8: Ipsum 7
9: Ipsum 8
10: Ipsum 9

C:\Programme\nodejs>

Ob das auf der gehosteten Domain auch klappt im Billigpaket, werde ich berichten.

Nochmals Dank an CPoly.

Grüße
Idi
 
Zuletzt bearbeitet von einem Moderator:
Bekomme sqlite3 auch nicht installiert und habe die Tipps auch nicht nachvollziehen koennen. Vlt. liegts auch daran, dass ich mich im kalten Wasser befinde.

Meine Fehlermeldung

Code:
C:\Users\Che\Documents\nfc>npm install sqlite3
npm WARN package.json nfc@0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/sqlite3
npm http 304 https://registry.npmjs.org/sqlite3

> sqlite3@2.1.5 install C:\Users\Che\Documents\nfc\node_modules\sqlite3
> node-gyp rebuild


C:\Users\Che\Documents\nfc\node_modules\sqlite3>node "C:\Program Files\nodejs\no
de_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" re
build
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:109:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:78:11
gyp ERR! stack     at Object.oncomplete (fs.js:297:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Che\Documents\nfc\node_modules\sqlite3
gyp ERR! node -v v0.8.14
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! sqlite3@2.1.5 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the sqlite3@2.1.5 install 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-gyp rebuild
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! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sqlite3"
npm ERR! cwd C:\Users\Che\Documents\nfc
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Che\Documents\nfc\npm-debug.log
npm ERR! not ok code 0
 
Nach Python Installation kommt:

Code:
C:\Users\Che\Documents>npm install sqlite3
npm http GET https://registry.npmjs.org/sqlite3
npm http 304 https://registry.npmjs.org/sqlite3

> sqlite3@2.1.5 install C:\Users\Che\Documents\node_modules\sqlite3
> node-gyp rebuild


C:\Users\Che\Documents\node_modules\sqlite3>node "C:\Program Files\nodejs\node_m
odules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuil
d
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: Die Plattform für Projekt "sqlite3.vcxproj" ist
ungültig.  Plattform="x64". Diese Meldung wird unter Umständen angezeigt, da ei
n Projekt ohne Projektmappendatei erstellt werden sollte und da eine nicht stan
dardmäßige Plattform angegeben wurde, die für das Projekt nicht vorhanden ist.
[C:\Users\Che\Documents\node_modules\sqlite3\build\deps\sqlite3\sqlite3.vcxproj
]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:236:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Che\Documents\node_modules\sqlite3
gyp ERR! node -v v0.8.14
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! sqlite3@2.1.5 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the sqlite3@2.1.5 install 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-gyp rebuild
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! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "sqlite3"
npm ERR! cwd C:\Users\Che\Documents
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Che\Documents\npm-debug.log
npm ERR! not ok code 0
 
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: Die Plattform für Projekt "sqlite3.vcxproj" ist
ungültig. Plattform="x64". Diese Meldung wird unter Umständen angezeigt, da ei
n Projekt ohne Projektmappendatei erstellt werden sollte und da eine nicht stan
dardmäßige Plattform angegeben wurde, die für das Projekt nicht vorhanden ist.
[C:\Users\Che\Documents\node_modules\sqlite3\build\deps\sqlite3\sqlite3.vcxproj
]

Bist du auf einem 32 bit System?
 

Neue Beiträge

Zurück