anza-xyz / octane

Octane is a gasless transaction relayer for Solana.
Apache License 2.0
226 stars 141 forks source link

Unable to install Octane as a node library per documented instructions #30

Open warlyware opened 1 year ago

warlyware commented 1 year ago

Describe the bug I am attempting to install octane via the instructions documented here: https://github.com/solana-labs/octane/blob/master/docs/library.md#install I attempted using an existing repo as well as a new blank repo. I am using yarn v3.5.0.

To Reproduce Steps to reproduce the behavior:

  1. Create new repo initiated with yarn init
  2. Attempt to install octane with provided instructions
  3. See error:
    Usage Error: It seems you are trying to add a package using a https:... url; we now require package names to be explicitly specified.
    Try running the command again with the package name prefixed: yarn add my-package@https:...
  4. Attempt to reinstall by prepending octane-core@ to the install command per error
  5. See next error:
    ➤ YN0000: ┌ Resolution step
    ➤ YN0001: │ Error: octane-core@https://gitpkg.now.sh/solana-labs/octane/packages/core?[...] isn't supported by any available resolver
    at xf.getResolverByDescriptor (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:391:1647)
    at xf.bindDescriptor (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:391:1036)
    at _ (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:439:6900)
    at async Promise.allSettled (index 0)
    at async to (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:390:10398)
    at async /Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:439:8205
    at async Ge.startProgressPromise (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:390:47579)
    at async je.resolveEverything (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:439:6233)
    at async /Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:442:2137
    at async Ge.startSectionPromise (/Users/warly/.cache/node/corepack/yarn/3.5.0/yarn.js:409:3292)
    ➤ YN0000: └ Completed
    ➤ YN0000: Failed with errors in 0s 14ms
  6. See that nothing has been installed to the node_modules folder.

Expected behavior The package should be installed in node_modules as expected.

Screenshots

Screenshot 2023-09-14 at 12 47 46 PM

Desktop (please complete the following information):

Additional context I tested with yarn in an empty repo for creating this issue, however I prefer using pnpm. Until the octane library is on NPM it would be helpful to have more complete install instructions for different package managers. Ideally it would be on NPM so devs could just run pnpm add @solana-labs/octane (or preferred package manager equivalent).

sourdzl commented 7 months ago

also running into this issue - trying to use pnpm and modified the documentation to

pnpm add 'https://gitpkg.now.sh/solana-labs/octane/packages/core?630a8d6afc90d2fe5aad88db2dc56c880cdbb5ad&scripts.postinstall=pnpm%20install%20--ignore-scripts%20%26%26%20pnpm%20run%20build'

but the post install hook failed as the script is hardcoded to use yarn:

Progress: resolved 1762, reused 1762, downloaded 0, added 0, done
│ Done in 3.4s
│ > @solana/octane-core@0.0.1 build MY_DIRECTORY/node_modules/@solana/octane-core
│ > yarn clean && tsc -p tsconfig.json
│ Usage Error: This project is configured to use pnpm
│ $ yarn ...
│  ELIFECYCLE  Command failed with exit code 1.