openwallet-foundation / credo-ts

Typescript framework for building decentralized identity and verifiable credential solutions
https://credo.js.org
Apache License 2.0
273 stars 200 forks source link

Dead link in demo docs #1577

Closed bryce-mcmath closed 9 months ago

bryce-mcmath commented 1 year ago

In the demo guide, there is a section for platform specific setup. https://github.com/hyperledger/aries-framework-javascript/tree/main/demo#platform-specific-setup

The only link for NodeJS in this section results in essentially a 404 page: page not found

genaris commented 1 year ago

Thanks for raising this up. I guess it should go to https://aries.js.org/guides/0.4/getting-started/prerequisites. For the moment, when running the demo from this repo we need to install also indy-sdk (even if not used for it), so you'll need to follow https://aries.js.org/guides/0.4/getting-started/set-up/indy-sdk#installing-the-indy-sdk.

Hopefully we'll fix this setup very soon (@TimoGlastra @berendsliedrecht please go ahead with the new shared component JS wrappers releases 🙏 🥺 😄 )!

bryce-mcmath commented 1 year ago

@genaris Not sure if this should be a separate issue or if I've just made a common blunder, but the install is failing even after following the indy-sdk guide.

Versions:

Mac: Ventura 13.5.2 (Intel) Homebrew: 4.1.12 Node: 16.15.1 Yarn: 1.22.19 Make: 4.4.1

Installed libindy with homebrew as per https://aries.js.org/guides/0.4/getting-started/set-up/indy-sdk/macos-intel Running npx -p @aries-framework/node@^0.3 is-indy-installed doesn't error

Error output from yarn install:

error /Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@16.15.1 | darwin | x64
gyp info find Python using Python version 3.11.5 found at "/usr/local/opt/python@3.11/bin/python3.11"
gyp info spawn /usr/local/opt/python@3.11/bin/python3.11
gyp info spawn args [
gyp info spawn args   '/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/bryce/Library/Caches/node-gyp/16.15.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/bryce/Library/Caches/node-gyp/16.15.1',
gyp info spawn args   '-Dnode_gyp_dir=/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/bryce/Library/Caches/node-gyp/16.15.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/indynodejs/src/indy.o
  SOLINK_MODULE(target) Release/indynodejs.node
ld: library not found for -lindy
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/indynodejs.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 22.6.0
gyp ERR! command "/Users/bryce/.nvm/versions/node/v16.15.1/bin/node" "/Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/bryce/repos/aries-framework-javascript/node_modules/indy-sdk

Tried from both the root of the project and from the demo folder, same result.

genaris commented 1 year ago

Oh that's sad 😞 . Clearly the key line there is ld: library not found for -lindy. @berendsliedrecht any idea what can be the reason for is-indy-installed to pass and not being able to find the libindy afterwards?

BTW a few weeks ago I've set up a separated repo extracting the demo (as a colleague of mine had issues as well), so it does not require Indy SDK: https://github.com/genaris/aries-framework-javascript-demo. It's slightly outdated but maybe can help you if you just want to start playing around with AFJ.

bryce-mcmath commented 1 year ago

I'll check it out and help if I can! Thank you.

berendsliedrecht commented 1 year ago

Hmm. It could simply be just to clean the project and reinstall everything. We is-indy-installed script uses the same way to access Indy as all the other projects (including the demo) so to me it seems something needs to be revalidated.

bryce-mcmath commented 1 year ago

For @berendsliedrecht: Is there any specific output for is-indy-installed that I should be looking for? For me it just installs a few packages and then exits without errors.

I tried switching to node v18.18.0 and doing a fresh clone and install. Ever so slightly different error but I also got a warning before the error, not sure if it will be helpful.

Warning during yarn install:

warning Error running install script for optional dependency: "/Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build=false
Arguments: 
Directory: /Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.17.0
node-pre-gyp info using node@18.18.0 | darwin | x64
node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp info check checked for \"/Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures/native/index.node\" (not found)
node-pre-gyp http GET https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.13.0/node-v108-darwin-x64.tar.gz
node-pre-gyp http 404 https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.13.0/node-v108-darwin-x64.tar.gz
node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.13.0/node-v108-darwin-x64.tar.gz
node-pre-gyp ERR! stack     at PassThrough.<anonymous> (/Users/brycem/work/aries-framework-javascript/node_modules/node-pre-gyp/lib/install.js:142:27)
node-pre-gyp ERR! stack     at PassThrough.emit (node:events:529:35)
node-pre-gyp ERR! stack     at ClientRequest.<anonymous> (/Users/brycem/work/aries-framework-javascript/node_modules/needle/lib/needle.js:538:9)
node-pre-gyp ERR! stack     at Object.onceWrapper (node:events:632:26)
node-pre-gyp ERR! stack     at ClientRequest.emit (node:events:517:28)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:700:27)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (node:_http_client:541:22)
node-pre-gyp ERR! stack     at TLSSocket.emit (node:events:517:28)
node-pre-gyp ERR! stack     at addChunk (node:internal/streams/readable:335:12)
node-pre-gyp ERR! System Darwin 22.6.0
node-pre-gyp ERR! command \"/Users/brycem/.nvm/versions/node/v18.18.0/bin/node\" \"/Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build=false\"
node-pre-gyp ERR! cwd /Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/bls12381-key-pair/node_modules/@mattrglobal/node-bbs-signatures
node-pre-gyp ERR! node -v v18.18.0
[1/13] ⠈ indy-sdk
[-/13] ⠈ waiting...
[-/13] ⠈ waiting...
[7/13] ⠈ ffi-napi
warning Error running install script for optional dependency: "/Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/node-bbs-signatures: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build=false
Arguments: 
Directory: /Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/node-bbs-signatures
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.9
node-pre-gyp info using node@18.18.0 | darwin | x64
node-pre-gyp info check checked for \"/Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/node-bbs-signatures/native/index.node\" (not found)
node-pre-gyp http GET https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.15.0/node-v108-darwin-x64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.15.0/node-v108-darwin-x64.tar.gz 
node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: response status 404 Not Found on https://github.com/mattrglobal/node-bbs-signatures/releases/download/0.15.0/node-v108-darwin-x64.tar.gz
node-pre-gyp ERR! stack     at /Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/node-bbs-signatures/node_modules/@mapbox/node-pre-gyp/lib/install.js:67:15
node-pre-gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
node-pre-gyp ERR! System Darwin 22.6.0
node-pre-gyp ERR! command \"/Users/brycem/.nvm/versions/node/v18.18.0/bin/node\" \"/Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/node-bbs-signatures/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build=false\"
node-pre-gyp ERR! cwd /Users/brycem/work/aries-framework-javascript/node_modules/@mattrglobal/node-bbs-signatures
node-pre-gyp ERR! node -v v18.18.0

Slightly different error after yarn install:

error /Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@18.18.0 | darwin | x64
gyp info find Python using Python version 3.11.5 found at "/usr/local/opt/python@3.11/bin/python3.11"
gyp info spawn /usr/local/opt/python@3.11/bin/python3.11
gyp info spawn args [
gyp info spawn args   '/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/brycem/Library/Caches/node-gyp/18.18.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/brycem/Library/Caches/node-gyp/18.18.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/brycem/Library/Caches/node-gyp/18.18.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/indynodejs/src/indy.o
  SOLINK_MODULE(target) Release/indynodejs.node
ld: library 'indy' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/indynodejs.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
gyp ERR! System Darwin 22.6.0
gyp ERR! command "/Users/brycem/.nvm/versions/node/v18.18.0/bin/node" "/Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/brycem/work/aries-framework-javascript/node_modules/indy-sdk

Is there another way to add indy-sdk than brew install blu3beri/libindy/libindy?

For @genaris: I get this error when I try to install your non-indy-sdk demo. I notice that ref-napi has a unique resolution in package.json is there anything special I need to do for that package?

error /Users/brycem/work/aries-framework-javascript-demo/node_modules/ref-napi: Command failed.
Exit code: 1
Command: node-gyp-build
Arguments: 
Directory: /Users/brycem/work/aries-framework-javascript-demo/node_modules/ref-napi
Output:
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:290:12)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ]

error Command failed with exit code 1.
genaris commented 1 year ago

I couldn't reproduce neither in my Macbook Pro M1 or in my x86_64 Linux box (even using the same npm and node versions as you), but I'm running into the same issue when attempting to create a Docker image based on node:lts. According to them, the problem can be related to the upgrade from npm 9.7.2 to 9.8.1: