Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local installation / setup error on macos #1031

Open
3 tasks done
uinstinct opened this issue Nov 5, 2024 · 4 comments
Open
3 tasks done

local installation / setup error on macos #1031

uinstinct opened this issue Nov 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@uinstinct
Copy link

Have you read a contributing guide?

  • I have read CONTRIBUTING.md
  • I have searched the existing issues and didn't find any that were similar
  • I have considered creating a pull request with fixes instead of a bug report and want to proceed

Current Behavior

antype-ts fails during installation with the following error on macos silicon

it seems to be some problem with keytar

npm i

> anytype@0.43.9-alpha postinstall
> npx electron-builder install-app-deps

  • electron-builder  version=24.13.3
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=keytar@7.9.0 platform=darwin arch=arm64
  ⨯ cannot execute  cause=exit status 1
                    errorOut=npm error code 1
    npm error path /Users/instinct/Desktop/anytype-ts/node_modules/keytar
    npm error command failed
    npm error command sh -c prebuild-install || npm run build
    npm error > keytar@7.9.0 build
    npm error > node-gyp rebuild
    npm error
    npm error   CXX(target) Release/obj.target/keytar/src/async.o
    npm error gyp info it worked if it ends with ok
    npm error gyp info using node-gyp@9.4.1
    npm error gyp info using node@20.5.1 | darwin | arm64
    npm error gyp info find Python using Python version 3.12.2 found at "/opt/miniconda3/bin/python3"
    npm error gyp info spawn /opt/miniconda3/bin/python3
    npm error gyp info spawn args [
    npm error gyp info spawn args   '/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/gyp/gyp_main.py',
    npm error gyp info spawn args   'binding.gyp',
    npm error gyp info spawn args   '-f',
    npm error gyp info spawn args   'make',
    npm error gyp info spawn args   '-I',
    npm error gyp info spawn args   '/Users/instinct/Desktop/anytype-ts/node_modules/keytar/build/config.gypi',
    npm error gyp info spawn args   '-I',
    npm error gyp info spawn args   '/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/addon.gypi',
    npm error gyp info spawn args   '-I',
    npm error gyp info spawn args   '/Users/instinct/.electron-gyp/33.0.1/include/node/common.gypi',
    npm error gyp info spawn args   '-Dlibrary=shared_library',
    npm error gyp info spawn args   '-Dvisibility=default',
    npm error gyp info spawn args   '-Dnode_root_dir=/Users/instinct/.electron-gyp/33.0.1',
    npm error gyp info spawn args   '-Dnode_gyp_dir=/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp',
    npm error gyp info spawn args   '-Dnode_lib_file=/Users/instinct/.electron-gyp/33.0.1/<(target_arch)/node.lib',
    npm error gyp info spawn args   '-Dmodule_root_dir=/Users/instinct/Desktop/anytype-ts/node_modules/keytar',
    npm error gyp info spawn args   '-Dnode_engine=v8',
    npm error gyp info spawn args   '--depth=.',
    npm error gyp info spawn args   '--no-parallel',
    npm error gyp info spawn args   '--generator-output',
    npm error gyp info spawn args   'build',
    npm error gyp info spawn args   '-Goutput_dir=.'
    npm error gyp info spawn args ]
    npm error gyp info spawn make
    npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    npm error ../src/async.cc:1:10: fatal error: 'string' file not found
    npm error     1 | #include <string>
    npm error       |          ^~~~~~~~
    npm error 1 error generated.
    npm error make: *** [Release/obj.target/keytar/src/async.o] Error 1
    npm error gyp ERR! build error
    npm error gyp ERR! stack Error: `make` failed with exit code: 2
    npm error gyp ERR! stack     at ChildProcess.onExit (/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/lib/build.js:203:23)
    npm error gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
    npm error gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
    npm error gyp ERR! System Darwin 24.0.0
    npm error gyp ERR! command "/Users/instinct/.nvm/versions/node/v20.5.1/bin/node" "/Users/instinct/Desktop/anytype-ts/node_modules/.bin/node-gyp" "rebuild"
    npm error gyp ERR! cwd /Users/instinct/Desktop/anytype-ts/node_modules/keytar
    npm error gyp ERR! node -v v20.5.1
    npm error gyp ERR! node-gyp -v v9.4.1
    npm error gyp ERR! not ok
    npm error A complete log of this run can be found in: /Users/instinct/.npm/_logs/2024-11-05T13_03_56_759Z-debug-0.log

                    command=/Users/instinct/.nvm/versions/node/v20.5.1/bin/node /Users/instinct/Desktop/anytype-ts/node_modules/npm/bin/npm-cli.js rebuild keytar@7.9.0
                    workingDir=
npm ERR! code 1

Expected Behavior

It should install by following the instructions on README

Steps To Reproduce

  1. git clone the repo
  2. run npm i
  3. check the logged errors

Environment

- OS: macOS 15
- Version:

Anything else?

No response

@uinstinct uinstinct added the bug Something isn't working label Nov 5, 2024
@ra3orblade
Copy link
Contributor

ra3orblade commented Nov 5, 2024

Python 3.12 and above does not contain setuptools and breaks node-gyp.

brew install python@3.11

@ra3orblade ra3orblade reopened this Nov 5, 2024
@uinstinct
Copy link
Author

Thanks for the tip!
Installed python 3.11 using brew

I got another error on npm i -D again:

  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=keytar@7.9.0 platform=darwin arch=arm64
  ⨯ cannot execute  cause=exit status 1
                    errorOut=npm ERR! code 1
    npm ERR! path /Users/instinct/Desktop/anytype-ts/node_modules/keytar
    npm ERR! command failed
    npm ERR! command sh -c prebuild-install || npm run build
    npm ERR! > keytar@7.9.0 build
    npm ERR! > node-gyp rebuild
    npm ERR! gyp info it worked if it ends with ok
    npm ERR! gyp info using node-gyp@9.4.1
    npm ERR! gyp info using node@20.13.1 | darwin | arm64
    npm ERR! gyp info find Python using Python version 3.13.0 found at "/opt/homebrew/opt/python@3.13/bin/python3.13"
    npm ERR! gyp info spawn /opt/homebrew/opt/python@3.13/bin/python3.13
    npm ERR! gyp info spawn args [
    npm ERR! gyp info spawn args   '/Users/instinct/Desktop/anytype-ts/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   '/Users/instinct/Desktop/anytype-ts/node_modules/keytar/build/config.gypi',
    npm ERR! gyp info spawn args   '-I',
    npm ERR! gyp info spawn args   '/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/addon.gypi',
    npm ERR! gyp info spawn args   '-I',
    npm ERR! gyp info spawn args   '/Users/instinct/.electron-gyp/33.0.1/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/instinct/.electron-gyp/33.0.1',
    npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp',
    npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/instinct/.electron-gyp/33.0.1/<(target_arch)/node.lib',
    npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/instinct/Desktop/anytype-ts/node_modules/keytar',
    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! Traceback (most recent call last):
    npm ERR!   File "/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
    npm ERR!     import gyp  # noqa: E402
    npm ERR!     ^^^^^^^^^^
    npm ERR!   File "/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
    npm ERR!     import gyp.input
    npm ERR!   File "/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
    npm ERR!     from distutils.version import StrictVersion
    npm ERR! ModuleNotFoundError: No module named 'distutils'
    npm ERR! gyp ERR! configure error
    npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
    npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/Users/instinct/Desktop/anytype-ts/node_modules/node-gyp/lib/configure.js:325:16)
    npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
    npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
    npm ERR! gyp ERR! System Darwin 24.0.0
    npm ERR! gyp ERR! command "/Users/instinct/.nvm/versions/node/v20.13.1/bin/node" "/Users/instinct/Desktop/anytype-ts/node_modules/.bin/node-gyp" "rebuild"
    npm ERR! gyp ERR! cwd /Users/instinct/Desktop/anytype-ts/node_modules/keytar
    npm ERR! gyp ERR! node -v v20.13.1
    npm ERR! gyp ERR! node-gyp -v v9.4.1
    npm ERR! gyp ERR! not ok

    npm ERR! A complete log of this run can be found in: /Users/instinct/.npm/_logs/2024-11-06T11_50_22_244Z-debug-0.log

                    command=/Users/instinct/.nvm/versions/node/v20.13.1/bin/node /Users/instinct/.nvm/versions/node/v20.13.1/lib/node_modules/npm/bin/npm-cli.js rebuild keytar@7.9.0
                    workingDir=
npm ERR! code 1

@ra3orblade
Copy link
Contributor

You have still 3.13 trying to run by node-gyp, you should remove it

gyp info find Python using Python version 3.13.0 found at "/opt/homebrew/opt/python@3.13/bin/python3.13"

@haron-IV
Copy link

haron-IV commented Nov 8, 2024

@ra3orblade You have pretty old stack here in the repo. Are there any plans to up it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants