Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed at the sqlite3@3.1.1 install script 'node-pre-gyp install --fallback-to-build' #612

Closed
glavince opened this issue Mar 10, 2016 · 54 comments

Comments

@glavince
Copy link

I have issue installing the latest version (3.1.1) of node-sqlite3 on Ubuntu

In the log file I can see that it is failing to download tarball:
403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.1/node-v46-linux-ia32.tar.gz (falling back to source compile with node-gyp)

node-sqlite3 version: 3.1.1
Node version: 4.3.1
NPM version: 2.14.12
OS info: Ubuntu 12.04.5 LTS 32 bit

Attached is the log result of "npm install sqlite3 --loglevel=info". log.txt and npm-debug.log.txt

@marshmelo777
Copy link

i hade this error and i solved it by update npm version with the command:
npm install -g npm@latest

make sure you have gcc and g++

sudo apt-get install gcc
sudo apt-get install g++
then try to install sqlite3 again:

npm install sqlite3

@glavince
Copy link
Author

@marshmelo777 Thanks for the help but it didn't fix the issue.
I updated NPM to v3.8.0 and already have gcc and g++ installed, but still get error.

@cquijano
Copy link

I can confirm @glavince , I have the same issue.

@marshmelo777
Copy link

Can you post the error?

@cquijano
Copy link

Of course , please please , fix it:

root@development:~# npm install -g sqlite3 

> sqlite3@3.1.1 install /usr/lib/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.7.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/sqlite3/.node-gyp"
make: Entering directory '/usr/lib/node_modules/sqlite3/build'
make: *** No rule to make target '../.node-gyp/5.7.1/include/node/common.gypi', needed by 'Makefile'.  Stop.
make: Leaving directory '/usr/lib/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/lib/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.2-std-1
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm"
gyp ERR! cwd /usr/lib/node_modules/sqlite3
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.2-std-1
node-pre-gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/sqlite3
node-pre-gyp ERR! node -v v5.7.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.14
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm' (1)
npm ERR! Linux 4.4.2-std-1
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "sqlite3"
npm ERR! node v5.7.1
npm ERR! npm  v3.8.1
npm ERR! code ELIFECYCLE

npm ERR! sqlite3@3.1.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.1.1 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, 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!     /root/npm-debug.log

@glavince
Copy link
Author

I fixed the issue with upgrading cpp, gcc and g++ to version 4.9. The previous version was 4.6

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
sudo rm /usr/bin/cpp /usr/bin/gcc /usr/bin/g++
sudo ln -s /usr/bin/cpp-4.9 /usr/bin/cpp
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++

@cquijano
Copy link

The soltion that @glavince didn't work for me , mi gcc version is 5 and I installed 4.9 with same resaults:

root@development:~# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/5/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.2.1-22ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) 
Before:
lrwxrwxrwx 1 root root 5 Aug  1  2015 /usr/bin/cpp -> cpp-5
After:
lrwxrwxrwx 1 root root 16 Mar 14 18:57 /usr/bin/cpp -> /usr/bin/cpp-4.9

root@development:~# npm install -g sqlite3 

> sqlite3@3.1.1 install /usr/lib/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.7.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/sqlite3/.node-gyp"
make: Entering directory '/usr/lib/node_modules/sqlite3/build'
make: *** No rule to make target '../.node-gyp/5.7.1/include/node/common.gypi', needed by 'Makefile'.  Stop.
make: Leaving directory '/usr/lib/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/lib/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.2-std-1
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm"
gyp ERR! cwd /usr/lib/node_modules/sqlite3
gyp ERR! node -v v5.7.1
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:100:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.2-std-1
node-pre-gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/sqlite3
node-pre-gyp ERR! node -v v5.7.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.14
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/sqlite3/lib/binding/node-v47-linux-arm' (1)
npm ERR! Linux 4.4.2-std-1
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "sqlite3"
npm ERR! node v5.7.1
npm ERR! npm  v3.8.1
npm ERR! code ELIFECYCLE

npm ERR! sqlite3@3.1.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.1.1 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, 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!     /root/npm-debug.log

@cquijano
Copy link

More info about the problem from npm-debug.log

126775 silly install sqlite3@3.1.1 /usr/lib/node_modules/.staging/sqlite3-fce72f2e
126776 info lifecycle sqlite3@3.1.1~install: sqlite3@3.1.1
126777 verbose lifecycle sqlite3@3.1.1~install: unsafe-perm in lifecycle false
126778 verbose lifecycle sqlite3@3.1.1~install: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/usr/lib/node_modules/strongloop/node_modules/sqlite3/node_modules/.bin:/usr/lib/node_modules/strongloop/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
126779 verbose lifecycle sqlite3@3.1.1~install: CWD: /usr/lib/node_modules/strongloop/node_modules/sqlite3
126780 silly lifecycle sqlite3@3.1.1~install: Args: [ '-c', 'node-pre-gyp install --fallback-to-build' ]
126781 silly lifecycle sqlite3@3.1.1~install: Returned: code: 1  signal: null
126782 info lifecycle sqlite3@3.1.1~install: Failed to exec install script
126783 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
126784 silly rollbackFailedOptional Starting
126785 silly rollbackFailedOptional Finishing
126786 silly runTopLevelLifecycles Starting
126787 silly runTopLevelLifecycles Finishing
126788 silly install printInstalled
126789 verbose stack Error: sqlite3@3.1.1 install: `node-pre-gyp install --fallback-to-build`
126789 verbose stack Exit status 1
126789 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
126789 verbose stack     at emitTwo (events.js:100:13)
126789 verbose stack     at EventEmitter.emit (events.js:185:7)
126789 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:24:14)
126789 verbose stack     at emitTwo (events.js:100:13)
126789 verbose stack     at ChildProcess.emit (events.js:185:7)
126789 verbose stack     at maybeClose (internal/child_process.js:827:16)
126789 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
126790 verbose pkgid sqlite3@3.1.1
126791 verbose cwd /root
126792 error Linux 4.4.2-std-1
126793 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "strongloop"
126794 error node v5.7.1
126795 error npm  v3.8.1
126796 error code ELIFECYCLE
126797 error sqlite3@3.1.1 install: `node-pre-gyp install --fallback-to-build`
126797 error Exit status 1
126798 error Failed at the sqlite3@3.1.1 install script 'node-pre-gyp install --fallback-to-build'.
126798 error Make sure you have the latest version of node.js and npm installed.
126798 error If you do, this is most likely a problem with the sqlite3 package,
126798 error not with npm itself.
126798 error Tell the author that this fails on your system:
126798 error     node-pre-gyp install --fallback-to-build
126798 error You can get information on how to open an issue for this project with:
126798 error     npm bugs sqlite3
126798 error Or if that isn't available, you can get their info via:
126798 error     npm owner ls sqlite3
126798 error There is likely additional logging output above.
126799 verbose exit [ 1, true ]

Maybe a posible workaround is to add ; exit 0 to the npm script as eslint/eslint#2409

@cquijano
Copy link

For me, the flag --unsafe-perm workarounded the problem

@manbusky
Copy link

The soltion that @glavince didn't work for me too.

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.2-20141101/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.2-20141101/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
node --version
v0.10.25
npm --version
1.3.24

@manbusky
Copy link

Failed to execute '/usr/local/node/bin/node /usr/local/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/opt/ghost/node_modules/sqlite3/lib/binding/node-v11-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/opt/ghost/node_modules/sqlite3/lib/binding/node-v11-linux-x64' (1)
npm ERR! sqlite3@3.1.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@3.1.1 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.10.0-123.9.3.el7.x86_64
npm ERR! command "/bin/node" "/bin/npm" "install" "sqlite3" "--save"
npm ERR! cwd /opt/ghost
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE

@JoeShi
Copy link

JoeShi commented Mar 24, 2016

I can confirm the error is still with version 3.1.2

    > sqlite3@3.1.2 install /usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.4.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.4.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.4.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: ENOENT: no such file or directory, utime '/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/.node-gyp/4.4.0/include/node/openssl/hmac.h'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 3.10.0-123.9.3.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/lib/binding/node-v46-linux-x64"
gyp ERR! cwd /usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/lib/binding/node-v46-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 3.10.0-123.9.3.el7.x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3
node-pre-gyp ERR! node -v v4.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.24
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/strong-pm/node_modules/minkelite/node_modules/sqlite3/lib/binding/node-v46-linux-x64' (1)

@rdeforest
Copy link

This is another case of #165, as are #485, #499 and #618. There may be others as well?

@resting
Copy link

resting commented Apr 3, 2016

I have problem with sqlite3 when upgrading ghost.
I think its the same problem.
Log: https://gist.github.com/resting/876f13e4d08813041016e1532528abb7

@rafaels88
Copy link

Having the same problem. Does anyone resolved it? My log:

I tried with and without --unsafe-per param.

OS Version: Ubuntu 16.04 x64

$ npm install sqlite3 --unsafe-per

> sqlite3@3.0.8 install /home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

make: Entering directory '/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/build'
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3080900/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3080900/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 ../src/database.h:11:0,
                 from ../src/database.cc:5:
../../nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../../nan/nan.h:256:25: note: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../../nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../../nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../../nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:672:67: error: no matching function for call to ‘New(v8::Isolate*, const char*&, uint32_t&)’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../../nan/nan.h:25:0,
                 from ../src/database.h:11,
                 from ../src/database.cc:5:
/home/flor/.node-gyp/4.4.4/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/flor/.node-gyp/4.4.4/include/node/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
In file included from ../src/database.h:11:0,
                 from ../src/database.cc:5:
../../nan/nan.h:672:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../../nan/nan.h:25:0,
                 from ../src/database.h:11,
                 from ../src/database.cc:5:
/home/flor/.node-gyp/4.4.4/include/node/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/flor/.node-gyp/4.4.4/include/node/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
In file included from ../src/database.h:11:0,
                 from ../src/database.cc:5:
../../nan/nan.h:672:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:676:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                             ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../../nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
../src/database.cc: In static member function ‘static void node_sqlite3::Database::Work_BeginOpen(node_sqlite3::Database::Baton*)’:
../src/database.cc:145: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:509: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:610:9: warning: unused variable ‘status’ [-Wunused-variable]
     int status = uv_queue_work(uv_default_loop(),
         ^
node_sqlite3.target.mk:106: recipe for target 'Release/obj.target/node_sqlite3/src/database.o' failed
make: *** [Release/obj.target/node_sqlite3/src/database.o] Error 1
make: Leaving directory '/home/flor/Workspace/vdeviagem/v-de-viagem/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-22-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/lib/binding/node-v46-linux-x64"
gyp ERR! cwd /home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3
gyp ERR! node -v v4.4.4
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/lib/binding/node-v46-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.4.0-22-generic
node-pre-gyp ERR! command "/usr/bin/nodejs" "/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3
node-pre-gyp ERR! node -v v4.4.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.7
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/lib/binding/node-v46-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/flor/Workspace/vdeviagem/v-de-viagem/node_modules/sqlite3/lib/binding/node-v46-linux-x64' (1)
npm WARN ghost@0.6.4 No license field.
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "sqlite3" "--unsafe-per"
npm ERR! node v4.4.4
npm ERR! npm  v3.9.0
npm ERR! code ELIFECYCLE

npm ERR! sqlite3@3.0.8 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.0.8 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, 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/flor/Workspace/vdeviagem/v-de-viagem/npm-debug.log

@Md-Hiccup
Copy link

I have the same issue on installing sqlite3 , but i solved it by installing dependencies "sqlite3" : "~3.1.4" .
Install it using command
npm uninstall sqlite3
npm cache clean
sudo npm install sqlite3

@multivac61
Copy link

I had a similar problem when installing Ghost on Ubuntu 16.04 LTS.

I traced the problem down to nodejs not being available in the path /usr/bin/node. Once I linked the nodejs binary to that path sqlite3 installed like a charm. You can link nodejs to /usr/bin/node using the following command:

sudo ln -s "$(which nodejs)" /usr/bin/node

@bazaglia
Copy link

@multivac61 Thank you, that solved it for Ubuntu 16.04. :)

@tony1016
Copy link

@multivac61 that's help,thx

@wethinkagile
Copy link

It's a Ghost Bug. You need tu upgrade version by version. 0.8, 0.9, 0.1 to avoid the error.

@antorenge
Copy link

@multivac61 that worked for me, ubuntu 16.04

@wezm
Copy link

wezm commented Sep 17, 2016

Note that Debian/Ubuntu provide a nodejs-legacy package that provides the necessary symlink:

sudo apt-get install nodejs-legacy

For more information, see http://lists.debian.org/debian-devel-announce/2012/07/msg00002.html

@homerjam
Copy link

@multivac61 my hero

@mikolajs
Copy link

mikolajs commented Oct 2, 2016

I had the same problem like @glavince Global install works but local not. I installed globally and copied sqlite3 to local node_modules.

@kamilpajak
Copy link

Problem persists on Debian 7 (Raspbian).

@Bilge
Copy link

Bilge commented Dec 31, 2016

I have this problem building sqlite3 (via Ghost) using Buildroot on a Debian 8 based host. @cquijano's solution worked for me.

@kenberkeley
Copy link

npm i sqlite3 --build-from-source may work

@QuinnFreedman
Copy link

for me the issue was that for some reason it was looking for node which is the legacy version of nodejs. Either install both or link them as @multivac61 suggested.

Also, make sure to run npm with sudo. Otherwise you will get a similar error.

@17hz
Copy link

17hz commented Mar 7, 2018

@multivac61 @cquijano Thanks,you are both work for me ~

@maneyko
Copy link

maneyko commented Jul 3, 2018

having the same issue, running npm install sqlite3

the log:


> sqlite3@3.1.13 install /Users/Maciej/projects/express-example/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-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.5.0 (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.5.0 (node-v64 ABI) (falling back to source compile with node-gyp)
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
  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
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
rm: ./Release/.deps/Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o.d.raw: No such file or directory
make: *** [Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o] Error 1
gyp  LIBTOOL-STATIC Release/sqlite3.a
 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:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.5.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64"
gyp ERR! cwd /Users/Maciej/projects/express-example/node_modules/sqlite3
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/Cellar/node/10.5.0_1/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/Maciej/projects/express-example/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:961:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
node-pre-gyp ERR! System Darwin 17.5.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/10.5.0_1/bin/node" "/Users/Maciej/projects/express-example/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/Maciej/projects/express-example/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/10.5.0_1/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64' (1)
Traceback (most recent call last):fo lifecycle sqlite3@3.1.13~install: Failed to exec install script
  File "./gyp-mac-tool", line 611, in <module>
  File "./gyp-mac-tool", line 28, in main
  File "./gyp-mac-tool", line 43, in Dispatch
  File "./gyp-mac-tool", line 246, in ExecFilterLibtool
TypeError: cannot use a string pattern on a bytes-like object
make: *** [Release/sqlite3.a] Error 1
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:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/Cellar/node/10.5.0_1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/Maciej/projects/express-example/node_modules/sqlite3/lib/binding/node-v64-darwin-x64"
gyp ERR! cwd /Users/Maciej/projects/express-example/node_modules/sqlite3
gyp ERR! node -v v10.5.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@3.1.13 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@3.1.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Maciej/.npm/_logs/2018-07-03T20_16_58_270Z-debug.log

running:
MacOS 10.13.4 on a MBP 11,1

Also, this issue has been open for over 2 years...

@springmeyer
Copy link
Contributor

Anyone hitting this issue please make sure you are running the latest node-sqlite@4.0.2. If you are still having problems with that version, then create a new issue.

@atul9911
Copy link

Install node-pre-gyp package.
https://www.npmjs.com/package/node-pre-gyp

@Garry050
Copy link

Garry050 commented Jun 1, 2019

same on CentOS7 sqlite3@4.0.8
why dev won't fix it?

@danieltanfh95
Copy link

danieltanfh95 commented Jul 20, 2019

Still broken with version 4.0.2 on mac

4.0.9 works on mac

@bolpol
Copy link

bolpol commented Jul 21, 2019

i hade this error and i solved it by update npm version with the command:
npm install -g npm@latest

make sure you have gcc and g++

sudo apt-get install gcc
sudo apt-get install g++
then try to install sqlite3 again:

npm install sqlite3

At first install sqlite3 then npm install)) Its a elegant work for me

@kurtpeek
Copy link

I ran into this issue trying to simply run an Apollo GraphQL tutorial (https://github.com/apollographql/fullstack-tutorial). Following this comment (fsevents/fsevents#278 (comment)), I simply deleted the package-lock.json and re-ran node install, which then worked.

@el0911
Copy link

el0911 commented Dec 19, 2019

npm i sqlite3 --build-from-source this worked for me after like 4 hours of bull bloody shit

@paulvanvulpen
Copy link

i hade this error and i solved it by update npm version with the command:
npm install -g npm@latest

make sure you have gcc and g++

sudo apt-get install gcc
sudo apt-get install g++
then try to install sqlite3 again:

npm install sqlite3

It didn't help me in Ubuntu, but npm install -g npm@latest did the trick for me in MacOS Catalina. Thanks a ton!

@sarmstead
Copy link

I have the same issue on installing sqlite3 , but i solved it by installing dependencies "sqlite3" : "~3.1.4" .
Install it using command
npm uninstall sqlite3
npm cache clean
sudo npm install sqlite3

Thanks, this worked for me! I did need to use --force to clear the cache (npm --force cache clean). A little scary, but things seem okay for now.

@yykoypj
Copy link

yykoypj commented Dec 8, 2020

I solved it by yarn global add node-pre-gyp

@ctjlewis
Copy link

For me, it turned out to be a python is not found error - sudo apt install python solved it.

@vhugorod
Copy link

vhugorod commented Feb 2, 2021

For me, it turned out to be a python is not found error - sudo apt install python solved it.

It worked for me. Thanks!

@iandees
Copy link

iandees commented Feb 7, 2021

For me, it turned out to be a python is not found error

The actual error for me was

/bin/sh: 1: python: not found

@Bhavya2021
Copy link

npx: installed 12 in 8.029s
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

sqlite3@4.2.0 install C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.16.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack at exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:465:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build"
"--module=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19042
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3
node-pre-gyp ERR! node -v v14.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN type-graphql@0.17.6 requires a peer of @types/graphql@^14.0.7 but none is installed. You must install peer dependencies yourself.
npm WARN myapi@0.0.1 No description
npm WARN myapi@0.0.1 No repository field.
npm WARN myapi@0.0.1 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.2.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bhavya\AppData\Roaming\npm-cache_logs\2021-06-16T10_42_05_738Z-debug.log
Command failed: npm install

@vhugorod
Copy link

npx: installed 12 in 8.029s
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated node-pre-gyp@0.11.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

sqlite3@4.2.0 install C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.16.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack at exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:465:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build"
"--module=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19042
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3
node-pre-gyp ERR! node -v v14.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Bhavya\Desktop\crud\typescript-graphql-crud\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN type-graphql@0.17.6 requires a peer of @types/graphql@^14.0.7 but none is installed. You must install peer dependencies yourself.
npm WARN myapi@0.0.1 No description
npm WARN myapi@0.0.1 No repository field.
npm WARN myapi@0.0.1 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.2.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bhavya\AppData\Roaming\npm-cache_logs\2021-06-16T10_42_05_738Z-debug.log
Command failed: npm install

Try to use "yarn add sqlite3" instead of "npm install sqlite3".

@trangchongcheng
Copy link

i hade this error and i solved it by update npm version with the command:
npm install -g npm@latest

make sure you have gcc and g++

sudo apt-get install gcc
sudo apt-get install g++
then try to install sqlite3 again:

npm install sqlite3

it work for me, only update npm :)

@kirillgroshkov
Copy link

I have solved it in CircleCI by installing apt install python-is-python3 package. So, python not found error disappeared.

Apparently, node-gyp indeed needed python3, just required it as python. So, the fix above worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests