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

Installi sqlite3 (windows): node-pre-gyp install --fallback-to-build

Open Orionsg opened this issue 10 years ago • 11 comments

npm-sqlite3-inst-info.txt npm-sqlite3-inst-info.txt

I just installed node.js a couple of days ago under Windows 7 (32 bit) with the MSI and have the versions: node -v : v4.4.3 npm -v : 2.15.1

When I try to install sqlite3: "npm install sqlite3 -save", I get:

[email protected] install C:\Users\Frank\AppData\Roaming\npm\node_modules\sqlite3 node-pre-gyp install --fallback-to-build

The command then hangs with no more information. After a long time, I then can use Ctrl-C to break the process (I see no CPU activity for the process): ^CTerminate batch job (Y/N)? y

Now, when I check the ...npm\node_modules folder there an sqlite3 folder created with sub folders and content.

As mentioned, this is a new node.js installation and this is the first npm package installed.

I have attached the output of installing with the command: npm install sqlite3 --loglevel=info

Orionsg avatar Apr 29 '16 17:04 Orionsg

try 'npm install sqlite3 source'

kxjhcs avatar May 22 '16 04:05 kxjhcs

I tried npm install sqlite3 source but got the error I'm getting on any other intsall

node v4.2.4 npm v1.4.3

Failed at the [email protected] install script

conor909 avatar May 25 '16 10:05 conor909

What level of Visual Studio compiler do you have installed?

shellberg avatar Jul 21 '16 16:07 shellberg

I have same question with using npm install sqlite3 --save. I do as follow: download: Visual Studio Build tools Python 2.7 installed: npm install node-gyp -gnode-gyp

Use npm install sqlite3 --build-from-source --save

But I'm failed. npm-debug.txt

console: D:\User\node.workSpace\3dmzt>npm install sqlite3 --build-from-source --save

[email protected] install D:\User\node.workSpace\3dmzt\node_modules\sqlite3 node-pre-gyp install --fallback-to-build

D:\User\node.workSpace\3dmzt\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean ) D:\User\node.workSpace\3dmzt\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64 ) else (node "" configure --fallback-to-build --module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64 )

D:\User\node.workSpace\3dmzt\node_modules\sqlite3>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64 ) else (node "" build --fallback-to-build --module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64 ) 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。 MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "14.0", "4.0"。 gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 10.0.14393 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64" gyp ERR! cwd D:\User\node.workSpace\3dmzt\node_modules\sqlite3 gyp ERR! node -v v7.2.0 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64' (1) node-pre-gyp ERR! stack at ChildProcess. (D:\User\node.workSpace\3dmzt\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:106:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:885:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) node-pre-gyp ERR! System Windows_NT 10.0.14393 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\User\node.workSpace\3dmzt\node_modules\sqlite3\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd D:\User\node.workSpace\3dmzt\node_modules\sqlite3 node-pre-gyp ERR! node -v v7.2.0 node-pre-gyp ERR! node-pre-gyp -v v0.6.31 node-pre-gyp ERR! not ok Failed to execute 'node-gyp.cmd build --fallback-to-build --module=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\User\node.workSpace\3dmzt\node_modules\sqlite3\lib\binding\node-v51-win32-x64' (1) npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "sqlite3" "--build-from-source" "--save" npm ERR! node v7.2.0 npm ERR! npm v3.10.9 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! 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! D:\User\node.workSpace\3dmzt\npm-debug.log

bingxueyizhou avatar Dec 20 '16 17:12 bingxueyizhou

I solve my problem.

the error:MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "14.0", "4.0"。 run npm config set msvs_version 2015.

bingxueyizhou avatar Dec 21 '16 14:12 bingxueyizhou

the error:MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "14.0", "4.0"。 run npm config set msvs_version 2015.

worked! thanks

ofek-a avatar Jan 11 '17 23:01 ofek-a

I meet the same problem, is there any way to solve it?

┌─[kands@kands-MicroPC] - [~] - [二 7月 07, 00:59] └─[$] <> sudo npm i -g sql-language-server [sudo] kands 的密码: /usr/local/bin/sql-language-server -> /usr/local/lib/node_modules/sql-language-server/dist/cli.js

[email protected] install /usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3 node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding' gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/10.19.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/sql-language-server/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: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/.node-gyp' gyp ERR! System Linux 5.4.0-40-generic gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding/node-v64-linux-x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64" gyp ERR! cwd /usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3 gyp ERR! node -v v10.19.0 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 '/usr/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding/node-v64-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/sql-language-server/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Linux 5.4.0-40-generic node-pre-gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/sql-language-server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3 node-pre-gyp ERR! node -v v10.19.0 node-pre-gyp ERR! node-pre-gyp -v v0.11.0 node-pre-gyp ERR! not ok Failed to execute '/usr/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/local/lib/node_modules/sql-language-server/node_modules/sqlite3/lib/binding/node-v64-linux-x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1) npm WARN [email protected] requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/sql-language-server/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 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. 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! /root/.npm/_logs/2020-07-06T17_00_09_122Z-debug.log ┌─[kands@kands-MicroPC] - [~] - [二 7月 07, 01:00] └─[$] <>

kands-code avatar Jul 06 '20 17:07 kands-code

I've solved this problem by adding an option '--unsafe-perm', hope it is also useful to you.

kands-code avatar Jul 06 '20 18:07 kands-code

npm install sqlite3 --build-from-source --save does not work npm install sqlite3 --unsafe-perm --save does not work npm config set msvs_version 2015 && npm install sqlite3 --save does not work

This breaks the Apollo tutorial at https://www.apollographql.com/docs/tutorial/introduction/ on WSL

StianOvrevage avatar Sep 01 '20 12:09 StianOvrevage

This may work:

In PowerShell:

wsl --list --verbose
wsl --set-version Ubuntu-20.04 2

In WSL2:

sudo apt-get install python
npm install sqlite

StianOvrevage avatar Sep 01 '20 12:09 StianOvrevage

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

daniellockyer avatar Apr 15 '22 09:04 daniellockyer