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

[HELP]: Error: Invalid secret key in environment variable 'SECRET_KEY'! #364

Open
nikaniknin opened this issue Aug 19, 2024 · 0 comments
Open

Comments

@nikaniknin
Copy link

nikaniknin commented Aug 19, 2024

Project: Introduction to cryptography and Solana clients

Lesson Number: https://solana.com/developers/courses/intro-to-solana/intro-to-cryptography, https://solana.com/developers/courses/intro-to-solana/intro-to-writing-data

Question

I learning solana with https://solana.com/developers/courses/intro-to-solana/intro-to-cryptography

I have secret key in .env in format:
SECRET_KEY="[(a series of numbers)]"

I installed
npm i @solana-developers/helpers

And all other nesessary things

run
npx esrun transfer.ts (public key)

got Error:

% npx esrun transfer.ts 4etzwnuNrSbzNeAn27ZoAaywgkEe8aVMxthb3pNWAsH7
/Users/…/node_modules/@solana-developers/helpers/dist/index.js:157
      throw new Error(
            ^

Error: Invalid secret key in environment variable 'SECRET_KEY'!
    at getKeypairFromEnvironment (/Users/…/node_modules/@solana-developers/helpers/dist/index.js:157:13)
    at file:///Users/.../[eval1]:21:21
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.eval (node:internal/modules/esm/loader:204:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Node.js v20.16.0

BUT
In my earlier projects the same operations don’t cause error.
I found difference in file /Users/…/node_modules/@solana-developers/helpers/dist/index.js in current (version 2.4) and previous projects (version 2.2).

And If I change file index.js in current project with index.js from older project, everything works (no errors).

What’s wrong with my current index.js? What should I do to make it work without this exchanges?

Code and Screenshots

@nikaniknin nikaniknin changed the title Error: Invalid secret key in environment variable 'SECRET_KEY'! [HELP]: Error: Invalid secret key in environment variable 'SECRET_KEY'! Aug 20, 2024
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

1 participant