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

Which Commit/Node Version To Use To Run Demo? #1627

Closed
jack-robson opened this issue Nov 6, 2023 · 4 comments
Closed

Which Commit/Node Version To Use To Run Demo? #1627

jack-robson opened this issue Nov 6, 2023 · 4 comments

Comments

@jack-robson
Copy link

jack-robson commented Nov 6, 2023

Hi. I've tried checking out a number of commits and a couple node versions but keep running into

Error: Command failed: node-pre-gyp install --target_arch=aarch64 --target_platform=darwin
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.10
node-pre-gyp info using node@18.18.2 | darwin | arm64
node-pre-gyp info check checked for "/Users/jr/Projects/temp/aries-framework-javascript/node_modules/@hyperledger/indy-vdr-nodejs/native/indy_vdr.node" (not found)
node-pre-gyp http GET https://github.com/hyperledger/indy-vdr/releases/download/v0.4.0/library-darwin-aarch64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/hyperledger/indy-vdr/releases/download/v0.4.0/library-darwin-aarch64.tar.gz 
node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: response status 404 Not Found on https://github.com/hyperledger/indy-vdr/releases/download/v0.4.0/library-darwin-aarch64.tar.gz
node-pre-gyp ERR! stack     at /Users/jr/Projects/temp/aries-framework-javascript/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/jr/.nvm/versions/node/v18.18.2/bin/node" "/Users/jr/Projects/temp/aries-framework-javascript/node_modules/@hyperledger/indy-vdr-nodejs/node_modules/.bin/node-pre-gyp" "install" "--target_arch=aarch64" "--target_platform=darwin"
node-pre-gyp ERR! cwd /Users/jr/Projects/temp/aries-framework-javascript/node_modules/@hyperledger/indy-vdr-nodejs
node-pre-gyp ERR! node -v v18.18.2
node-pre-gyp ERR! node-pre-gyp -v v1.0.10
node-pre-gyp ERR! not ok 

    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at Object.<anonymous> (/Users/jr/Projects/temp/aries-framework-javascript/node_modules/@hyperledger/indy-vdr-nodejs/scripts/install.js:14:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12)
    at node:internal/main/run_main_module:23:47 {
  status: 1,
  signal: null,

I followed the instructions https://aries.js.org/guides/0.4/getting-started/set-up/indy-sdk/macos-arm numerous times. I have the missing libs installed, though I didn't have the /usr/local/lib/ folder. I created it but it's read only. I put it in /opt/homebrew/lib instead.

npx -p @aries-framework/node@^0.3 is-indy-installed

keeps going round in circles

jr@JRobson-UKMAC23 ~ % npx -p @aries-framework/node@^0.3 is-indy-installed
Need to install the following packages:
@aries-framework/node@0.3.3
Ok to proceed? (y) 


Error: dlopen(/Users/jr/.npm/_npx/b2013cfe335b6227/node_modules/indy-sdk/build/Release/indynodejs.node, 0x0001): Library not loaded: /Users/beri/developer/work/hyperledger/indy-sdk/libindy/target/release/deps/libindy.dylib
  Referenced from: <3F5DEAB5-E10F-3B66-B4B7-0E3EB1082ED9> /Users/jr/.npm/_npx/b2013cfe335b6227/node_modules/indy-sdk/build/Release/indynodejs.node
  Reason: tried: '/Users/beri/developer/work/hyperledger/indy-sdk/libindy/target/release/deps/libindy.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/beri/developer/work/hyperledger/indy-sdk/libindy/target/release/deps/libindy.dylib' (no such file), '/Users/beri/developer/work/hyperledger/indy-sdk/libindy/target/release/deps/libindy.dylib' (no such file)
    at Module._extensions..node (node:internal/modules/cjs/loader:1340:18)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at bindings (/Users/jr/.npm/_npx/b2013cfe335b6227/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/Users/jr/.npm/_npx/b2013cfe335b6227/node_modules/indy-sdk/src/indyBinding.js:1:37)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32) {
  code: 'ERR_DLOPEN_FAILED'
}

Notice it's looking at a different developers location, I'm not sure how to change from '/Users/beri/developer/work/hyperledger/indy-sdk/libindy/target/release/deps/libindy.dylib' to '/opt/homebrew/lib/libindy.dylib'

Any help appreciated. Thank you 🙏

@genaris
Copy link
Contributor

genaris commented Nov 6, 2023

Regarding the first issue (404 downloading indy-vdr binaries), it has been fixed in @hyperledger/indy-vdr-nodejs 0.2.0-dev.5, so probably it will go away if you change the dependencies in demo/package.json (and maybe also in packages/indy-vdr/package.json). This will be hopefully fixed soon (it is already done in #1427).

However, you may still have a problem with that indy-sdk dlopen error. Maybe the original beri (@berendsliedrecht 😄) can tell us how to workaround this. This started to happen to me when I upgraded my Macbook Pro M1 to Sonoma (macOS 14.0). Maybe the pre-built binaries are not compatible anymore? Anyway, we expect to completely remove indy-sdk dependency in the repo for 0.5.0 so it is in the works.

Thank you for your patience!

@berendsliedrecht
Copy link
Contributor

Sadly the indy-sdk does not use the new /opt/homebrew/* as a pattern for system dependencies. I believe there is an env var that can be used for this, but I believe the indy-sdk by default looks for /usr/lib and usr/local/lib. Maybe change the permissions of the /usr/local/lib? Can be done with chmod 755 /usr/local/lib, but double check that these are actually the correct permissions.

@jack-robson
Copy link
Author

I tried todo this last night but it wanted me to boot into recovery mode. I tried to build the library again but it was failing on my M1.

Fortunately my team has some working examples so I will no longer be trying to get the demo to run. Hoping I don't run into this issue in the other examples. 🤞

Thanks for the help though 👍

@berendsliedrecht
Copy link
Contributor

Oh that is interesting. We are quickly moving away from the indy-sdk and with the new shared components (indy-vdr, anoncreds-rs and aries-askar) these issues won't occur anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants