-
Notifications
You must be signed in to change notification settings - Fork 94
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
privateKey: Buffer.from('...') #446
Comments
@YanDevDe facing the same issue .. what did work for you ? |
Convert the Buffer to string: privateKey: buffer.toString(“utf8”) Make sure that the key is in PEM format (if not, you may need to convert it) |
Would think that reading the file as UTF-8 would work, but I get: const privateKey = await fs.readFile(env.SSH_privateKey, 'utf-8');
// Error: ENOENT: no such file or directory, stat '-----BEGIN OPENSSH PRIVATE KEY----- … I also get errors when I try to use the const privateKeyPath = '/myPathTo/id_ed25519';
// TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined So not figured out how to get this to work, and had to downgrade to 12.05 for now. EDIT: Turns out my first approach worked, also what steelbrain suggested bellow, but I had some error checks in my own client that was the issue. |
@ecker00 I think you're trying to read the private key (which is already the key itself, not a path) as a path from the filesystem. In your case, you may be able to get away with just replacing with the following code: const privateKey = Buffer.from(env.SSH_privateKey, 'utf-8') |
README.md shows
privateKey: Buffer.from('...')
, but I assume the privateKey expects only string, or not?Would fix this typo to avoid confusion as setting Buffer in privateKey actually won't work.
The text was updated successfully, but these errors were encountered: