inukshuk / sqleton

Visualize your SQLite database schema
GNU General Public License v3.0
110 stars 12 forks source link

Global npm install fails on Linux, despite sudo/root access #8

Closed gamesguru closed 3 years ago

gamesguru commented 3 years ago

Confirmed as likely not an environment or npm bug, due to other packages installing fine to /usr/lib, e.g. react-scripts and table

$ sudo npm i -g sqleton

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/bin/sqleton -> /usr/lib/node_modules/sqleton/bin/sqleton

> sqlite3@5.0.0 install /usr/lib/node_modules/sqleton/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 sqlite3@5.0.0 and node@14.11.0 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/lib/node_modules/sqleton/node_modules/sqlite3/lib/binding' 
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/14.11.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/sqleton/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/lib/node_modules/sqleton/node_modules/sqlite3/.node-gyp'
gyp ERR! System Linux 5.4.0-48-generic
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/sqleton/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/usr/lib/node_modules/sqleton/node_modules/sqlite3/lib/binding/napi-v3-linux-x64" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /usr/lib/node_modules/sqleton/node_modules/sqlite3
gyp ERR! node -v v14.11.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/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/sqleton/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/sqleton/node_modules/sqlite3/lib/binding/napi-v3-linux-x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/sqleton/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Linux 5.4.0-48-generic
node-pre-gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/sqleton/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/lib/node_modules/sqleton/node_modules/sqlite3
node-pre-gyp ERR! node -v v14.11.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/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/lib/node_modules/sqleton/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/usr/lib/node_modules/sqleton/node_modules/sqlite3/lib/binding/napi-v3-linux-x64 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@5.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@5.0.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!     /root/.npm/_logs/2020-09-22T15_21_01_625Z-debug.log
gamesguru commented 3 years ago

i cloned the repo and it installed easily with this

git clone ..
cd sqleton
sudo npm i -g .
inukshuk commented 3 years ago

Looks like a permission issue when compiling the sqlite3 native binding.