node-sqlite3 icon indicating copy to clipboard operation
node-sqlite3 copied to clipboard

sqlite3 issue on x64 platform

Open KiritoStudio opened this issue 12 years ago • 11 comments

Hi, I have reinstall my vps from x86 to x64. But an error happened: root@kiritovps:~/my_node/Main# node app.js

module.js:340 throw err; ^ Error: Cannot find module '/root/my_node/Main/node_modules/sqlite3/lib/binding/n ode-v11-linux-x64/node_sqlite3.node' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/root/my_node/Main/node_modules/sqlite3/lib/sqlite3.j s:4:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

I have checked my node version by node -v, it is v0.10.31, why the sqlite3 lib need v11?

KiritoStudio avatar Sep 02 '14 01:09 KiritoStudio

Because it's process.versions.modules.

Mithgol avatar Sep 02 '14 02:09 Mithgol

More importantly, the sqlite3 module expects to contain an addon built for the platform it runs on, and thus you cannot just copy it from a 32bit system to the 64bit system; instead of it, you'll have to reinstall sqlite3 after the platform changes.

In the /root/my_node/Main/ directory run the following:

  • npm uninstall sqlite3
  • npm install sqlite3

Mithgol avatar Sep 02 '14 02:09 Mithgol

I have deleted the node_modules folder and reinstall all node_modules again, also not worked. But..using Ubuntu 12.04 x64 instead of Ubuntu 14.04 x64 is a workaround. I don't know why.

KiritoStudio avatar Sep 02 '14 03:09 KiritoStudio

Same here, failed to install, seeing different error messages time to time.

# npm install -D sqlite3
npm WARN deprecated [email protected]: Use `setimmediate` instead

> [email protected] install /www/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! UNCAUGHT EXCEPTION 
node-pre-gyp ERR! stack Error: EPERM, chown '/www/node_modules/sqlite3/lib/binding/node-v11-linux-x64/node_sqlite3.node'
node-pre-gyp ERR! System Linux 3.13.0-35-generic
node-pre-gyp ERR! command "node" "/www/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /www/node_modules/sqlite3
node-pre-gyp ERR! node -v v0.10.29
node-pre-gyp ERR! node-pre-gyp -v v0.5.22
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the [email protected] 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 Linux 3.13.0-35-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-D" "sqlite3"
npm ERR! cwd /www
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /www/npm-debug.log
npm ERR! not ok code 0

alexindigo avatar Sep 03 '14 00:09 alexindigo

Get the same error here under windows 7 x64

sixertoy avatar Sep 03 '14 08:09 sixertoy

Hello, i have the same pb ->

[email protected] install /home/mma/neskouik/hubot-irc/Poney/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! UNCAUGHT EXCEPTION node-pre-gyp ERR! stack Error: EACCES, mkdir '/home/mma/neskouik/hubot-irc/Poney/node_modules/sqlite3/lib/binding' node-pre-gyp ERR! System Linux 3.2.0-35-generic node-pre-gyp ERR! command "node" "/usr/bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/mma/neskouik/hubot-irc/Poney/node_modules/sqlite3 node-pre-gyp ERR! node -v v0.10.16 node-pre-gyp ERR! node-pre-gyp -v v0.5.23 node-pre-gyp ERR! This is a bug in node-pre-gyp. node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help: node-pre-gyp ERR! https://github.com/mapbox/node-pre-gyp/issues npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the [email protected] 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 Linux 3.2.0-35-generic npm ERR! command "node" "/usr/bin/npm" "install" npm ERR! cwd /home/mma/neskouik/hubot-irc/Poney npm ERR! node -v v0.10.16 npm ERR! npm -v 1.4.25 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /home/mma/neskouik/hubot-irc/Poney/npm-debug.log npm ERR! not ok code 0 root@admin-dc3:/home/mma/neskouik/hubot-irc/Poney# npm uninstall sqlite3 npm WARN uninstall not installed in /home/mma/neskouik/hubot-irc/Poney/node_modules: "sqlite3"

gmangin avatar Sep 03 '14 12:09 gmangin

is anyone still hitting EACCES or EPERM errors? These look to me like problems with either permissions on your system or something else. I'm not seeing how this could be a bug in node-sqlite or node-pre-gyp and I'm also not able to replicate.

springmeyer avatar Sep 21 '14 06:09 springmeyer

I keep running into this same issue on RHEL6. It works fine on my OS X dev machine but my VM just keeps failing. Tried multiple versions of node and as both regular user and as root, but over and over I keep getting this:

[bberan@xxxxx ghost]$ npm install sqlite3
-
> [email protected] install /home/bberan/ghost/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/bberan/ghost/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3080701/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3080701/sqlite3.o
  AR(target) Release/obj.target/deps/sqlite3.a
  COPY Release/sqlite3.a
  CXX(target) Release/obj.target/node_sqlite3/src/database.o
../src/database.cc: In static member function ‘static void node_sqlite3::Database::New(const v8::FunctionCallbackInfo<v8::Value>&)’:
../src/database.cc:134: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::String>, v8::PropertyAttribute)’
/home/bberan/.node-gyp/0.12.0/deps/v8/include/v8.h:2112: note: candidates are: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>)
/home/bberan/.node-gyp/0.12.0/deps/v8/include/v8.h:2114: note:                 bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>)
../src/database.cc:135: error: no matching function for call to ‘v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::Integer>, v8::PropertyAttribute)’
/home/bberan/.node-gyp/0.12.0/deps/v8/include/v8.h:2112: note: candidates are: bool v8::Object::Set(v8::Handle<v8::Value>, v8::Handle<v8::Value>)
/home/bberan/.node-gyp/0.12.0/deps/v8/include/v8.h:2114: note:                 bool v8::Object::Set(uint32_t, v8::Handle<v8::Value>)
../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)’:
../src/database.cc:145: warning: unused variable ‘status’
../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginClose(node_sqlite3::Database::Baton*)’:
../src/database.cc:230: warning: unused variable ‘status’
../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginExec(node_sqlite3::Database::Baton*)’:
../src/database.cc:509: warning: unused variable ‘status’
../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginLoadExtension(node_sqlite3::Database::Baton*)’:
../src/database.cc:610: warning: unused variable ‘status’
make: *** [Release/obj.target/node_sqlite3/src/database.o] Error 1
make: Leaving directory `/home/bberan/ghost/node_modules/sqlite3/build'
gyp ERR! build error
gyp ERR! stack Error: `make` 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.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 2.6.32-431.29.2.el6.x86_64
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=3.0.4" "--major=3" "--patch=4" "--runtime=node" "--node_abi=node-v14" "--platform=linux" "--target_platform=linux" "--arch=x64" "--target_arch=x64" "--module_main=./lib/sqlite3" "--host=https://mapbox-node-binary.s3.amazonaws.com/" "--module_path=/home/bberan/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64" "--module=/home/bberan/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node" "--remote_path=./sqlite3/v3.0.4/" "--package_name=node-v14-linux-x64.tar.gz" "--staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz" "--hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/" "--hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz"
gyp ERR! cwd /home/bberan/ghost/node_modules/sqlite3
gyp ERR! node -v v0.12.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/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=3.0.4 --major=3 --patch=4 --runtime=node --node_abi=node-v14 --platform=linux --target_platform=linux --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=/home/bberan/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64 --module=/home/bberan/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node --remote_path=./sqlite3/v3.0.4/ --package_name=node-v14-linux-x64.tar.gz --staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/bberan/ghost/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:1008:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
node-pre-gyp ERR! System Linux 2.6.32-431.29.2.el6.x86_64
node-pre-gyp ERR! command "node" "/home/bberan/ghost/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/bberan/ghost/node_modules/sqlite3
node-pre-gyp ERR! node -v v0.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.1
node-pre-gyp ERR! not ok
Failed to execute '/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=3.0.4 --major=3 --patch=4 --runtime=node --node_abi=node-v14 --platform=linux --target_platform=linux --arch=x64 --target_arch=x64 --module_main=./lib/sqlite3 --host=https://mapbox-node-binary.s3.amazonaws.com/ --module_path=/home/bberan/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64 --module=/home/bberan/ghost/node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node --remote_path=./sqlite3/v3.0.4/ --package_name=node-v14-linux-x64.tar.gz --staged_tarball=build/stage/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz --hosted_path=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/ --hosted_tarball=https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.0.4/node-v14-linux-x64.tar.gz' (1)
npm ERR! Linux 2.6.32-431.29.2.el6.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "sqlite3"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
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! Please include the following file with any support request:
npm ERR!     /home/bberan/ghost/npm-debug.log

turboki avatar Feb 20 '15 21:02 turboki

@turboki - your issue is that you are using [email protected] and [email protected] is needed to support node v0.12 (https://github.com/mapbox/node-sqlite3/blob/master/CHANGELOG.md#305). This particular ticket is old so I'm going to close it. Feel free to open a new issue if upgrading to [email protected] does not resolve your issue.

springmeyer avatar Feb 20 '15 21:02 springmeyer

I am trying to setup ghost on my local, and it requires sqlite3. I tried installed the normal way i.e

npm install sqlite3

It did install, but still node complains that it cant find the module. I tried the @3.0.5 and it gives me this error:

npm WARN EPACKAGEJSON openshift-ghost-quickstart@ No license field.
npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "install" "[email protected]"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
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! Please include the following file with any support request:
npm ERR!     /Users/DextorG/Documents/Projects/Node/portfolio/npm-debug.log
npm ERR! code 1

Could you please advice.

Thank you!

jeremyrajan avatar Apr 27 '16 13:04 jeremyrajan

My best guess is that [email protected] does not work on Node.js version 5.0.0 because that Node's support is implemented in [email protected] (relatively later), according to the changelog.

Mithgol avatar May 22 '16 18:05 Mithgol