Galooshi / import-js

A tool to simplify importing JS modules
MIT License
525 stars 55 forks source link

Fails to install: node-pre-gyp? #573

Closed mikabytes closed 3 years ago

mikabytes commented 3 years ago
npm install -g import-js

It complains about deprecation in node-pre-gyp, and something about sqlite3 not found. Not sure what's going on. This is a fresh install of Ubuntu 21.04 running NodeJS v16.3

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 ERR! code 1
npm ERR! path /home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! make: Entering directory '/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/build'
npm ERR!   ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
npm ERR! make: Leaving directory '/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/build'
npm ERR! Failed to execute '/home/mika/.nvm/versions/node/v16.3.0/bin/node /home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@16.3.0 | linux | x64
npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz
npm ERR! node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@16.3.0 (node-v93 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-linux-x64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.3.0 | linux | x64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.3.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "/usr/bin/python3"
npm ERR! (node:15669) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/mika/.cache/node-gyp/16.3.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/mika/.cache/node-gyp/16.3.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/mika/.cache/node-gyp/16.3.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.3.0 | linux | x64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! /bin/sh: 1: python: not found
npm ERR! make: *** [deps/action_before_build.target.mk:13: Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.11.0-18-generic
npm ERR! gyp ERR! command "/home/mika/.nvm/versions/node/v16.3.0/bin/node" "/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3
npm ERR! gyp ERR! node -v v16.3.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok 
npm ERR! node-pre-gyp ERR! build error 
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/home/mika/.nvm/versions/node/v16.3.0/bin/node /home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3/lib/binding/node-v93-linux-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Linux 5.11.0-18-generic
npm ERR! node-pre-gyp ERR! command "/home/mika/.nvm/versions/node/v16.3.0/bin/node" "/home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/mika/.nvm/versions/node/v16.3.0/lib/node_modules/import-js/node_modules/sqlite3
npm ERR! node-pre-gyp ERR! node -v v16.3.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mika/.npm/_logs/2021-06-21T10_11_54_159Z-debug.log
mikabytes commented 3 years ago

I get the same result if I download the source code and run npm i

mikabytes commented 3 years ago

Submitted pull-request. The issue was that the sqlite binaries for 4.x.x has been removed from the server, so we have to use v5.2, or find some package other than sqlite.

tung-eh commented 3 years ago

I got the same issue with node >= 14

mikabytes commented 3 years ago

The PR works still. It just needs to be merged.