Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Fails to install dependencies #77

Closed
djmtype opened this issue Mar 28, 2022 · 8 comments
Closed

Fails to install dependencies #77

djmtype opened this issue Mar 28, 2022 · 8 comments

Comments

@djmtype
Copy link

djmtype commented Mar 28, 2022

On an ARM Mac I tried to install dependencies with Node 16.14 and v14.

I followed the instructions here: https://github.com/directus/examples/blob/main/directus/README.md

❯ node -v
v16.14.2

/Volumes/Evo/Sites/astro-directus/directus                                                                               12:50:50 PM
❯ npm i
npm WARN deprecated @types/[email protected]: This is a stub types definition. pino provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: This module renamed to process-warning
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: 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 [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! CC(target) Release/obj.target/nothing/node_modules/node-addon-api/nothing.o
npm ERR!   LIBTOOL-STATIC Release/nothing.a
npm ERR!   ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3340000/sqlite3.c
npm ERR! Failed to execute '/Users/scottrod/.nvm/versions/node/v16.14.2/bin/node /Users/scottrod/.nvm/versions/node/v16.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-darwin-arm64.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.9 found at "/opt/homebrew/opt/[email protected]/bin/python3.9"
npm ERR! gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/scottrod/.nvm/versions/node/v16.14.2/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   '/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/scottrod/.nvm/versions/node/v16.14.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/scottrod/Library/Caches/node-gyp/16.14.2/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=/Users/scottrod/Library/Caches/node-gyp/16.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/scottrod/.nvm/versions/node/v16.14.2/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/scottrod/Library/Caches/node-gyp/16.14.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Volumes/Evo/Sites/astro-directus/directus/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 [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
npm ERR! /bin/sh: python: command not found
npm ERR! make: *** [Release/obj/gen/sqlite-autoconf-3340000/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 (/Users/scottrod/.nvm/versions/node/v16.14.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! gyp ERR! command "/Users/scottrod/.nvm/versions/node/v16.14.2/bin/node" "/Users/scottrod/.nvm/versions/node/v16.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
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 '/Users/scottrod/.nvm/versions/node/v16.14.2/bin/node /Users/scottrod/.nvm/versions/node/v16.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3/lib/binding/napi-v3-darwin-arm64 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Volumes/Evo/Sites/astro-directus/directus/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Darwin 21.4.0
npm ERR! node-pre-gyp ERR! command "/Users/scottrod/.nvm/versions/node/v16.14.2/bin/node" "/Volumes/Evo/Sites/astro-directus/directus/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Volumes/Evo/Sites/astro-directus/directus/node_modules/sqlite3
npm ERR! node-pre-gyp ERR! node -v v16.14.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/scottrod/.npm/_logs/2022-03-28T16_50_59_788Z-debug-0.log
@djmtype
Copy link
Author

djmtype commented Mar 28, 2022

Might be related to this issue? directus/directus#12414

@djmtype
Copy link
Author

djmtype commented Mar 28, 2022

I tried rolling back to the latest node 14 version and had no issues. Maybe 16.14.2 is too green?

@azrikahar
Copy link
Contributor

Might be related to this issue? directus/directus#12414

I believe it is not related to directus/directus#12414, but rather closer to TryGhost/node-sqlite3#1424 instead, where this should be something to do with mapbox/sqlite3 not having precompiled binaries for ARM architecture.

I tried rolling back to the latest node 14 version and had no issues. Maybe 16.14.2 is too green?

Judging from the error Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp), I'm inclined to believe that it worked when you rolled back to node 14 because they do provide pre-compiled binaries for node 14 instead.

With that said, it also seems like your building from source is failing because of /bin/sh: python: command not found python not installed? Perhaps you can try installing it and see whether it works? Unfortunately I do not have a M1/ARM-based Mac so perhaps @rijkvanzanten can help confirm whether I am recommending the correct steps here.

@rijkvanzanten
Copy link
Contributor

Unfortunately I do not have a M1/ARM-based Mac so perhaps @rijkvanzanten can help confirm whether I am recommending the correct steps here.

I don't have one anymore either 🥲 @joselcvarela?

@joselcvarela
Copy link

I think sqlite3 from Mapbox does not have proper binaries for Apple Silicon.
Can you test install SQLite from brew then try it again?
brew install sqlite3

@djmtype
Copy link
Author

djmtype commented Mar 29, 2022

I think sqlite3 from Mapbox does not have proper binaries for Apple Silicon.
Can you test install SQLite from brew then try it again?
brew install sqlite3

I previously had sqlite3 installed with brew. It made no difference.

❯ brew install sqlite3
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
compiledb                  jdtls                      powerman-dockerize
easeprobe                  openjdk@17
==> Updated Formulae
Updated 60 formulae.
==> Deleted Formulae
autopano-sift-c
==> Updated Casks
Updated 36 casks.

Warning: sqlite 3.38.2 is already installed and up-to-date.
To reinstall 3.38.2, run:
  brew reinstall sqlite

@djmtype
Copy link
Author

djmtype commented Mar 29, 2022

I ran postinstall, then tried running Directus with DB_CLIENT="/usr/bin/sqlite3".

Now receiving: "DB_HOST" Environment Variable is missing.

@djmtype
Copy link
Author

djmtype commented Mar 29, 2022

Seems to be an open issue since MacOS 12.3. TryGhost/node-sqlite3#1552

I'm going to close this since it has nothing to do with Directus.

@djmtype djmtype closed this as completed Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants