Node-sqlite3: [email protected] not installing

Created on 18 Sep 2018  路  9Comments  路  Source: mapbox/node-sqlite3

`npm i -g [email protected]

[email protected] install /usr/local/lib/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 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/sqlite3/lib/binding'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/10.10.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/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/sqlite3/.node-gyp'
gyp ERR! System Linux 4.4.103-6.38-default
gyp ERR! command "/usr/local/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/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/local/lib/node_modules/sqlite3/lib/binding/node-v64-linux-x64" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /usr/local/lib/node_modules/sqlite3
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
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 configure --fallback-to-build --module=/usr/local/lib/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/local/lib/node_modules/sqlite3/lib/binding/node-v64-linux-x64 --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/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:962:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
node-pre-gyp ERR! System Linux 4.4.103-6.38-default
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.3
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 configure --fallback-to-build --module=/usr/local/lib/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/local/lib/node_modules/sqlite3/lib/binding/node-v64-linux-x64 --napi_version=3 --node_abi_napi=napi' (1)
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.`

Im using node:
node -v
v10.10.0
npm -v
6.4.1

Most helpful comment

Reason that I installed it globally is so that multiple users can use it.

npm i -g [email protected] --unsafe-perm worked for me thanks

All 9 comments

Im running it as root

Why are you running this as root? That's insane.

This is not a bug in the software, rather a permission issue with your system.
/close

Same issue for me reported in #994.

You have to install it using root as a global package and how can root have premission denied if its the super user? You know that sudo npm install and doing it as npm install as root is basically the same thing. I only enabled the super user to install all the global packages.

please use

npm i -g [email protected] --unsafe-perm

see unsafe-perm

I don't suggest installing it globally. I don't ever install any npm package as root.

Reason that I installed it globally is so that multiple users can use it.

npm i -g [email protected] --unsafe-perm worked for me thanks

worked for me.thank

following worked. thanks
npm i -g sqlite3 --unsafe-perm

Was this page helpful?
0 / 5 - 0 ratings