Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

can not find sqlite3 module in node.js v9.0.0 #902

Closed

Description

@liukaigsx
No description provided.

Activity

  1. nshtg commented on Nov 2, 2017

    @nshtg
    • Building fallback fails on node 9.0.0 on both windows and linux
  2. nshtg commented on Nov 5, 2017

    @nshtg

    If you want to build sqlite with docker you need additional dependencies:

    # If there are no pre-built sqlite3 versions available we have to build it.
    RUN apk --no-cache add --virtual .build-dependencies python gcc g++ make \
     && npm install --strip . \
     && npm cache clean --force \
     && apk del .build-dependencies
    
  3. patlachance commented on Nov 5, 2017

    @patlachance

    same issue when trying to install as root in docker container with:
    node -v: 9.0.0
    npm -v: 5.5.1
    docker: 17.10.0-ce

    # npm install -g sqlite3              
    
    > sqlite3@3.1.13 install /usr/local/lib/node_modules/sqlite3
    > node-pre-gyp install --fallback-to-build
    
    node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-linux-x64.tar.gz 
    node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@9.0.0 (node-v59 ABI) (falling back to source compile with node-gyp) 
    node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-linux-x64.tar.gz 
    node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@9.0.0 (node-v59 ABI) (falling back to source compile with node-gyp) 
    gyp WARN EACCES user "undefined" does not have permission to access the dev dir "/root/.node-gyp/9.0.0"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp"
    gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp/9.0.0"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp"
    gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp/9.0.0"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp"
    gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp/9.0.0"
    gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sqlite3/.node-gyp"
    gyp WARN EACCES us
    

    Adding --unsafe-perm leads to

    # npm install -g sqlite3 --unsafe-perm
    
    > sqlite3@3.1.13 install /usr/local/lib/node_modules/sqlite3
    > node-pre-gyp install --fallback-to-build
    
    node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v59-linux-x64.tar.gz 
    node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@9.0.0 (node-v59 ABI) (falling back to source compile with node-gyp) 
    make: Entering directory '/usr/local/lib/node_modules/sqlite3/build'
      ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
      TOUCH Release/obj.target/deps/action_before_build.stamp
      CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
      AR(target) Release/obj.target/deps/sqlite3.a
      COPY Release/sqlite3.a
      CXX(target) Release/obj.target/node_sqlite3/src/database.o
    In file included from ../node_modules/nan/nan.h:192:0,
                     from ../src/database.h:10,
                     from ../src/database.cc:4:
    ../node_modules/nan/nan_maybe_43_inl.h: In function 'Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)':
    ../node_modules/nan/nan_maybe_43_inl.h:112:73: warning: 'v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)' is deprecated (declared at /root/.node-gyp/9.0.0/include/node/v8.h:3114): Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
       return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
                                                                             ^
    ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)':
    ../src/database.cc:144:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),
             ^
    ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginClose(node_sqlite3::Database::Baton*)':
    ../src/database.cc:230:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),
             ^
    ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginExec(node_sqlite3::Database::Baton*)':
    ../src/database.cc:525:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),
             ^
    ../src/database.cc: In static member function 'static void node_sqlite3::Database::Work_BeginLoadExtension(node_sqlite3::Database::Baton*)':
    ../src/database.cc:625:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),
             ^
      CXX(target) Release/obj.target/node_sqlite3/src/node_sqlite3.o
    In file included from ../node_modules/nan/nan.h:192:0,
                     from ../src/database.h:10,
                     from ../src/node_sqlite3.cc:8:
    ../node_modules/nan/nan_maybe_43_inl.h: In function 'Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)':
    ../node_modules/nan/nan_maybe_43_inl.h:112:73: warning: 'v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)' is deprecated (declared at /root/.node-gyp/9.0.0/include/node/v8.h:3114): Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
       return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
                                                                             ^
      CXX(target) Release/obj.target/node_sqlite3/src/statement.o
    In file included from ../node_modules/nan/nan.h:192:0,
                     from ../src/database.h:10,
                     from ../src/statement.cc:7:
    ../node_modules/nan/nan_maybe_43_inl.h: In function 'Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)':
    ../node_modules/nan/nan_maybe_43_inl.h:112:73: warning: 'v8::Maybe<bool> v8::Object::ForceSet(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)' is deprecated (declared at /root/.node-gyp/9.0.0/include/node/v8.h:3114): Use CreateDataProperty / DefineOwnProperty [-Wdeprecated-declarations]
       return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
                                                                             ^
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginPrepare(node_sqlite3::Database::Baton*)':
    ../src/statement.cc:118:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),
             ^
    In file included from ../src/statement.cc:6:0:
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginBind(node_sqlite3::Statement::Baton*)':
    ../src/macros.h:125:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),                              \
             ^
    ../src/statement.cc:322:5: note: in expansion of macro 'STATEMENT_BEGIN'
         STATEMENT_BEGIN(Bind);
         ^
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginGet(node_sqlite3::Statement::Baton*)':
    ../src/macros.h:125:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),                              \
             ^
    ../src/statement.cc:370:5: note: in expansion of macro 'STATEMENT_BEGIN'
         STATEMENT_BEGIN(Get);
         ^
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginRun(node_sqlite3::Statement::Baton*)':
    ../src/macros.h:125:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),                              \
             ^
    ../src/statement.cc:438:5: note: in expansion of macro 'STATEMENT_BEGIN'
         STATEMENT_BEGIN(Run);
         ^
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginAll(node_sqlite3::Statement::Baton*)':
    ../src/macros.h:125:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),                              \
             ^
    ../src/statement.cc:504:5: note: in expansion of macro 'STATEMENT_BEGIN'
         STATEMENT_BEGIN(All);
         ^
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginEach(node_sqlite3::Statement::Baton*)':
    ../src/macros.h:125:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),                              \
             ^
    ../src/statement.cc:601:5: note: in expansion of macro 'STATEMENT_BEGIN'
         STATEMENT_BEGIN(Each);
         ^
    ../src/statement.cc: In static member function 'static void node_sqlite3::Statement::Work_BeginReset(node_sqlite3::Statement::Baton*)':
    ../src/macros.h:125:9: warning: unused variable 'status' [-Wunused-variable]
         int status = uv_queue_work(uv_default_loop(),                              \
             ^
    ../src/statement.cc:724:5: note: in expansion of macro 'STATEMENT_BEGIN'
         STATEMENT_BEGIN(Reset);
         ^
      SOLINK_MODULE(target) Release/obj.target/node_sqlite3.node
      COPY Release/node_sqlite3.node
      COPY /usr/local/lib/node_modules/sqlite3/lib/binding/node-v59-linux-x64/node_sqlite3.node
      TOUCH Release/obj.target/action_after_build.stamp
    make: Leaving directory '/usr/local/lib/node_modules/sqlite3/build'
    + sqlite3@3.1.13
    added 114 packages in 51.393s
    
  4. rpellerin commented on Nov 7, 2017

    @rpellerin

    Would love to see this issue fixed as well :)

  5. lhammond commented on Nov 14, 2017

    @lhammond

    same here

  6. telmotrooper commented on Nov 20, 2017

    @telmotrooper

    Arch Linux has updated it's Node.js package to 9.2.0, which broke node-sqlite3 for me.

    I tried downgrading the package with sudo pacman -U /var/cache/pacman/pkg/nodejs-8.8.1-1-x86_64.pkg.tar.xz, but then I couldn't even get node to run, since it seems to rely on some other library that has also been updated. The error I get is:
    node: error while loading shared libraries: libicui18n.so.59: cannot open shared

    For the time being some of my projects will have to be developed on Windows (since there I can use Node.js 8.9.1 LTS just fine). I hope you guys get around to fixing it soon though.

  7. k2s commented on Nov 20, 2017

    @k2s

    @telmotrooper I am also developping under ArchLinux. I am using https://github.com/creationix/nvm (it exists also in AUR). That way I have full controll what nodejs version I am using depending on project.

  8. telmotrooper commented on Nov 20, 2017

    @telmotrooper

    @k2s I'll give it a try when I get home, thanks!

  9. telmotrooper commented on Nov 22, 2017

    @telmotrooper

    Just wanted to let you guys now, the method suggested by @k2s works really well and it's quite easy to do.

    Just installed nvm with curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash, then nvm install 8.9.1 and nvm install 9.2.0 to get both Node.js versions, and nvm use 8 to use 8.9.1. Then I could run npm install just fine in my project that uses node-sqlite3.

  10. Dzieni commented on Dec 1, 2017

    @Dzieni

    Actually, there is an issue during the module compilation on Node v9.2:

    In file included from /Users/michald/.node-gyp/9.2.0/include/node/node.h:63:
    /Users/michald/.node-gyp/9.2.0/include/node/v8.h:208:5: error: assigning to 'v8::Context *volatile' from incompatible type 'v8::String *'
        TYPE_CHECK(T, S);
        ^~~~~~~~~~~~~~~~
    /Users/michald/.node-gyp/9.2.0/include/node/v8.h:162:37: note: expanded from macro 'TYPE_CHECK'
        *(static_cast<T* volatile*>(0)) = static_cast<S*>(0);      \
                                        ^ ~~~~~~~~~~~~~~~~~~
    ../src/database.cc:133:27: note: in instantiation of function template specialization 'v8::Local<v8::Context>::Local<v8::String>' requested here
        info.This()->ForceSet(Nan::New("filename").ToLocalChecked(), info[0].As<String>(), ReadOnly);
                              ^
    
  11. mah3uz commented on Jan 4, 2018

    @mah3uz

    Same problem here, any chance to get the solution for build <v7.x Nodejs

  12. fractalbeauty commented on Jan 5, 2018

    @fractalbeauty

    Still happening to me too...

    node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.12/node-v59-win32-x64.tar.gz
    node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.12 and node@9.2.0 (node-v59 ABI) (falling back to source compile with node-gyp)
    

    and then the build fails too....

  13. fractalbeauty commented on Jan 5, 2018

    @fractalbeauty

    Fixed it by using NVM to switch between node versions... anything prior to 9.0.0 seems to work for me.

  14. eMerzh commented on Jan 14, 2018

    @eMerzh

    Same thing with node 9.4.0 here on osx

  15. k1r0s commented on Jan 15, 2018

    @k1r0s

    Just came acros this issue, no pressure! 👍

  16. daniellockyer commented on Apr 15, 2022

    @daniellockyer
    Contributor

    Would you be able to try with v5.0.3 please? 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions