TryGhost / node-sqlite3

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

Can't npm install on FreeBSD 9.0 #149

Closed kurepin closed 11 years ago

kurepin commented 11 years ago

Hello,

Today catch the problem to (re)install sqlite3 on FreeBSD 9, after usual update ports (two servers, user root):

npm install -g sqlite3

npm http GET https://registry.npmjs.org/sqlite3 npm http 200 https://registry.npmjs.org/sqlite3 npm http GET https://registry.npmjs.org/sqlite3/-/sqlite3-2.1.9.tgz npm http 200 https://registry.npmjs.org/sqlite3/-/sqlite3-2.1.9.tgz npm http GET https://registry.npmjs.org/tar.gz npm http 200 https://registry.npmjs.org/tar.gz npm http GET https://registry.npmjs.org/tar.gz/-/tar.gz-0.1.1.tgz npm http 200 https://registry.npmjs.org/tar.gz/-/tar.gz-0.1.1.tgz npm WARN engine tar.gz@0.1.1: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.8","npm":"1.2.30"}) npm http GET https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/fstream npm http GET https://registry.npmjs.org/tar npm http 200 https://registry.npmjs.org/tar npm http GET https://registry.npmjs.org/tar/-/tar-0.1.17.tgz npm http 200 https://registry.npmjs.org/fstream npm http GET https://registry.npmjs.org/fstream/-/fstream-0.1.22.tgz npm http 200 https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/commander/-/commander-1.1.1.tgz npm http 200 https://registry.npmjs.org/tar/-/tar-0.1.17.tgz npm http 200 https://registry.npmjs.org/fstream/-/fstream-0.1.22.tgz npm http 200 https://registry.npmjs.org/commander/-/commander-1.1.1.tgz npm http GET https://registry.npmjs.org/keypress npm http GET https://registry.npmjs.org/rimraf npm http GET https://registry.npmjs.org/mkdirp npm http GET https://registry.npmjs.org/graceful-fs npm http GET https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/block-stream npm http 200 https://registry.npmjs.org/keypress npm http 200 https://registry.npmjs.org/mkdirp npm http 200 https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz npm http GET https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz npm http 200 https://registry.npmjs.org/graceful-fs npm http GET https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.2.tgz npm http 200 https://registry.npmjs.org/rimraf npm http GET https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz npm http 200 https://registry.npmjs.org/block-stream npm http GET https://registry.npmjs.org/block-stream/-/block-stream-0.0.6.tgz npm http 200 https://registry.npmjs.org/inherits npm http 200 https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz npm http 200 https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz npm http 200 https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.2.tgz npm http 200 https://registry.npmjs.org/block-stream/-/block-stream-0.0.6.tgz npm http 200 https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz

sqlite3@2.1.9 install /usr/local/lib/node_modules/sqlite3 node-gyp rebuild

gmake: cwd /usr/local/lib/node_modules/sqlite3/build' ACTION binding_gyp_action_before_build_target_unpack_sqlite_dep deps/sqlite-autoconf-3071700/sqlite3.c Extracting... Done! TOUCH Release/obj.target/action_before_build.stamp CC(target) Release/obj.target/sqlite3/deps/sqlite-autoconf-3071700/sqlite3.o ../deps/sqlite-autoconf-3071700/sqlite3.c:23527: error: 'fchmod' undeclared here (not in a function) ../deps/sqlite-autoconf-3071700/sqlite3.c: In function 'porter_stemmer': ../deps/sqlite-autoconf-3071700/sqlite3.c:127209: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127213: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127226: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127231: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127237: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127242: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127251: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127258: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127301: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127321: warning: value computed is not used gmake: *** [Release/obj.target/sqlite3/deps/sqlite-autoconf-3071700/sqlite3.o] ?????? 1 gmake: ????? ?? ????????/usr/local/lib/node_modules/sqlite3/build' gyp ERR! build error gyp ERR! stack Error: gmake failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12) gyp ERR! System FreeBSD 9.0-RELEASE gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/sqlite3 gyp ERR! node -v v0.10.8 gyp ERR! node-gyp -v v0.10.0 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0

Can you help me?

P.S. Previous versions was install && work properly.

springmeyer commented 11 years ago

Thanks for the report. I recently upgraded the bundled sqlite3 version and it looks like it suffers from a bug. So the solution is likely to patch it or roll back a version. Until I have time to do that you can work around the problem by instead building against an external SQLite. Do this by downloading the package manually, installing node-gyp, and passing --sqlite=/usr like described in the README.

kurepin commented 11 years ago

Thank you very much!

Do this by downloading the package manually, installing node-gyp, and passing --sqlite=/usr like described in the README.

It works. ;)

springmeyer commented 11 years ago

@kurepin - researching this more - it appears the compile error only will impact freebsd. Can you try just doing

export _XOPEN_SOURCE=600
npm install sqlite

Let me know if that works around the problem too?

refs: http://www3.sqlite.org/cgi/src/info/61a1045239 and https://code.google.com/p/go-sqlite/source/browse/go1/sqlite3/sqlite3.patch?spec=svn6753f82ad23bba1f307feeb9ede2eb5126106663&r=6753f82ad23bba1f307feeb9ede2eb5126106663

kurepin commented 11 years ago

On the same server:

npm cache clean export _XOPEN_SOURCE=600 npm install sqlite3 npm WARN package.json npm-compat@1.0.1 No repository field. npm http GET https://registry.npmjs.org/sqlite3 npm http 200 https://registry.npmjs.org/sqlite3 npm http GET https://registry.npmjs.org/sqlite3/-/sqlite3-2.1.10.tgz npm http 200 https://registry.npmjs.org/sqlite3/-/sqlite3-2.1.10.tgz npm http GET https://registry.npmjs.org/tar.gz npm http 200 https://registry.npmjs.org/tar.gz npm http GET https://registry.npmjs.org/tar.gz/-/tar.gz-0.1.1.tgz npm http 200 https://registry.npmjs.org/tar.gz/-/tar.gz-0.1.1.tgz npm WARN engine tar.gz@0.1.1: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.8","npm":"1.2.28"}) npm http GET https://registry.npmjs.org/fstream npm http GET https://registry.npmjs.org/tar npm http GET https://registry.npmjs.org/commander npm http 200 https://registry.npmjs.org/fstream npm http GET https://registry.npmjs.org/fstream/-/fstream-0.1.22.tgz npm http 200 https://registry.npmjs.org/tar npm http GET https://registry.npmjs.org/tar/-/tar-0.1.17.tgz npm http 200 https://registry.npmjs.org/commander npm http GET https://registry.npmjs.org/commander/-/commander-1.1.1.tgz npm http 200 https://registry.npmjs.org/fstream/-/fstream-0.1.22.tgz npm http 200 https://registry.npmjs.org/tar/-/tar-0.1.17.tgz npm http 200 https://registry.npmjs.org/commander/-/commander-1.1.1.tgz npm http GET https://registry.npmjs.org/rimraf npm http GET https://registry.npmjs.org/mkdirp npm http GET https://registry.npmjs.org/graceful-fs npm http GET https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/block-stream npm http 200 https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz npm http 200 https://registry.npmjs.org/mkdirp npm http GET https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz npm http 200 https://registry.npmjs.org/inherits npm http 200 https://registry.npmjs.org/graceful-fs npm http GET https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.2.tgz npm http 200 https://registry.npmjs.org/rimraf npm http GET https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz npm http 200 https://registry.npmjs.org/block-stream npm http GET https://registry.npmjs.org/block-stream/-/block-stream-0.0.6.tgz npm http 200 https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz npm http 200 https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz npm http 200 https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.2.tgz npm http 200 https://registry.npmjs.org/rimraf/-/rimraf-2.1.4.tgz npm http 200 https://registry.npmjs.org/block-stream/-/block-stream-0.0.6.tgz

sqlite3@2.1.10 install /usr/local/lib/node_modules/sqlite3 node-gyp rebuild

gmake: ???? ? ??????? /usr/local/lib/node_modules/sqlite3/build' ACTION binding_gyp_action_before_build_target_unpack_sqlite_dep deps/sqlite-autoconf-3071700/sqlite3.c Extracting... Done! TOUCH Release/obj.target/action_before_build.stamp CC(target) Release/obj.target/sqlite3/deps/sqlite-autoconf-3071700/sqlite3.o ../deps/sqlite-autoconf-3071700/sqlite3.c:23527: error: 'fchmod' undeclared here (not in a function) ../deps/sqlite-autoconf-3071700/sqlite3.c: In function 'porter_stemmer': ../deps/sqlite-autoconf-3071700/sqlite3.c:127209: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127213: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127226: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127231: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127237: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127242: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127251: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127258: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127301: warning: value computed is not used ../deps/sqlite-autoconf-3071700/sqlite3.c:127321: warning: value computed is not used gmake: *** [Release/obj.target/sqlite3/deps/sqlite-autoconf-3071700/sqlite3.o] ?????? 1 gmake: ????? ?? ????????/usr/local/lib/node_modules/sqlite3/build' gyp ERR! build error gyp ERR! stack Error: gmake failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12) gyp ERR! System FreeBSD 9.0-RELEASE gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/sqlite3 gyp ERR! node -v v0.10.8 gyp ERR! node-gyp -v v0.10.0 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0

springmeyer commented 11 years ago

okay, thanks for trying. I think for now stick with the workaround of not using the internal build and rather building against external sqlite. I presume this will be fixed in upcoming sqlite3 versions, so I'd appreciate testing once we upgrade.

kurepin commented 11 years ago

Okay. Always ready for testing.

springmeyer commented 11 years ago

closing, planning to upgrade the internal version soon which will fix this: https://github.com/developmentseed/node-sqlite3/issues/207

Nevering commented 10 years ago

Freebsd failed to install with can't download sqlite-autoconf-3080403.tar.gz , any workaround for this ?

springmeyer commented 10 years ago

@Nevering - please create a new issue rather than commenting on a closed issue. When you create that new issue please provide the sqlite3 version you are installing and the full error message.

Nevering commented 10 years ago

Ok On Jul 24, 2014, at 3:10 PM, Dane Springmeyer notifications@github.com wrote:

@Nevering - please create a new issue rather than commenting on a closed issue. When you create that new issue please provide the sqlite3 version you are installing and the full error message.

— Reply to this email directly or view it on GitHub.

Nevering commented 10 years ago

Trying to locate where to set ENV variable. Or should I deinstall 2.7 and reinstall. Not sure how 2.7 got installed, by something else that needed it prob.

npm WARN deprecated set-immediate@0.1.1: Use setimmediate instead

sqlite3@2.2.4 install /usr/local/include/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:103:14) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:42:11 gyp ERR! stack at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:25) gyp ERR! stack at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29) gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16 gyp ERR! stack at Object.oncomplete (evalmachine.:107:15) gyp ERR! System FreeBSD 10.0-RELEASE gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=sqlite3" "--configuration=Release" "--module_name=node_sqlite3" "--version=2.2.4" "--major=2" "--minor=2" "--patch=4" "--runtime=node" "--node_abi=node-v11" "--platform=freebsd" "--target_platform=freebsd" "--arch=x64" "--target_arch=x64" "--module_main=./lib/sqlite3" "--host=https://node-sqlite3.s3.amazonaws.com/" "--module_path=/usr/local/include/node_modules/sqlite3/lib/binding/node-v11-freebsd-x64" "--remote_path=./Release/" "--package_name=node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz" "--staged_tarball=build/stage/Release/node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz" "--hosted_path=https://node-sqlite3.s3.amazonaws.com/Release/" "--hosted_tarball=https://node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz" gyp ERR! cwd /usr/local/include/node_modules/sqlite3 gyp ERR! node -v v0.10.28 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=sqlite3 --configuration=Release --module_name=node_sqlite3 --version=2.2.4 --major=2 --minor=2 --patch=4 --runtime=node --node_abi=node-v11 --platform=freebsd --target_platform=freebsd --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://node-sqlite3.s3.amazonaws.com/ --module_path=/usr/local/include/node_modules/sqlite3/lib/binding/node-v11-freebsd-x64 --remote_path=./Release/ --package_name=node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz --staged_tarball=build/stage/Release/node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz --hosted_path=https://node-sqlite3.s3.amazonaws.com/Release/ --hosted_tarball=https://node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz' (1) node-pre-gyp ERR! stack at ChildProcess. (/usr/local/include/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:76:29) node-pre-gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) node-pre-gyp ERR! stack at maybeClose (child_process.js:753:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:5) node-pre-gyp ERR! System FreeBSD 10.0-RELEASE node-pre-gyp ERR! command "node" "/usr/local/include/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /usr/local/include/node_modules/sqlite3 node-pre-gyp ERR! node -v v0.10.28 node-pre-gyp ERR! node-pre-gyp -v v0.5.19 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node rebuild --name=sqlite3 --configuration=Release --module_name=node_sqlite3 --version=2.2.4 --major=2 --minor=2 --patch=4 --runtime=node --node_abi=node-v11 --platform=freebsd --target_platform=freebsd --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://node-sqlite3.s3.amazonaws.com/ --module_path=/usr/local/include/node_modules/sqlite3/lib/binding/node-v11-freebsd-x64 --remote_path=./Release/ --package_name=node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz --staged_tarball=build/stage/Release/node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz --hosted_path=https://node-sqlite3.s3.amazonaws.com/Release/ --hosted_tarball=https://node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.2.4-node-v11-freebsd-x64.tar.gz' (1) npm ERR! sqlite3@2.2.4 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@2.2.4 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-pre-gyp install --fallback-to-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! System FreeBSD 10.0-RELEASE npm ERR! command "node" "/usr/local/bin/npm" "install" "sqlite3" npm ERR! cwd /usr/local/include npm ERR! node -v v0.10.28 npm ERR! npm -v 1.4.15 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /usr/local/include/npm-debug.log npm ERR! not ok code 0