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

Error : spawn gpg ENOENT #27

Open
taeverapon32 opened this issue Aug 29, 2017 · 8 comments
Open

Error : spawn gpg ENOENT #27

taeverapon32 opened this issue Aug 29, 2017 · 8 comments

Comments

@taeverapon32
Copy link

I try to run examples\encrypt.js and found the error results here

{ Error: spawn gpg ENOENT
at exports._errnoException (util.js:1018:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:367:16)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn gpg',
path: 'gpg',
spawnargs: [ '--batch', '--encrypt' ] }

@satheeshtcs
Copy link

any solution for the above issue?

@freewil
Copy link
Collaborator

freewil commented Feb 7, 2018

Have you installed gpg cli tool? What is the output of $ gpg --version ?

@satheeshtcs
Copy link

satheeshtcs commented Feb 7, 2018

I didn't installed gpg cli tool. I am installed using npm install gpg . Here is my code,

var gpg = require('gpg'),
...
gpg.encryptToFile({source:fileToWrite, dest: './export/test.dat' }, function(err, data){
                console.log(err);
 });

After running this file, I am getting the above error. But empty file is generated inside the export folder.
is there anything need to add.

@freewil
Copy link
Collaborator

freewil commented Feb 7, 2018

I didn't installed gpg cli tool

You need to install this in order to use the npm package gpg. This package is a simple wrapper around the cli tool.

@satheeshtcs
Copy link

satheeshtcs commented Feb 8, 2018

@freewil I am using windows 10 machine. Can you explain which one can i download and install. Also please explain after installation which steps i can follow for using gpg encrypt/decrypt?
UPDATE:
I have installed the GnuPG in my windows machine. After the installation i set environment variable inside path as C:\Program Files (x86)\GNU\GnuPG . After that i tried gpg --version in command prompt. But i am getting the error like gpg is not recognized as an internal or external command, operable program or batch file. . can you explain which i am missing?

@satheeshtcs
Copy link

satheeshtcs commented Feb 9, 2018

@freewil , After setting C:\Program Files (x86)\GNU\GnuPG\pub in the environment variables i am able to see the gpg --version

gpg (GnuPG) 2.0.29 (Gpg4win 2.3.0)
libgcrypt 1.6.4
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: C:/Users/user/AppData/Roaming/gnupg
Supported algorithms:
Pubkey: RSA, RSA, RSA, ELG, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

I hope it was installed in my system. Then i tried in the code. Now the error is gone. but the file encrypted as 0KB. There is no data inside the file. The code for encryption is below,

gpg.encryptToFile({source:fileToWrite, dest: './export/test.txt' }, function(err, data){
                    console.log(err);
                    });

Suggest me is anything i am missing?

@rjain3
Copy link

rjain3 commented Feb 9, 2021

@satheeshtcs, I am also facing the same error. Will you be able to find any solution for this?

@ReenigneArcher
Copy link

I am facing this issue in the codecov-action v4, per codecov/codecov-action#1279 (comment). Same issue in GitHub hosted runners (macOS-12 and macOS-13), macOS-14 does not have the problem.

gpg --version

gpg (GnuPG) 2.4.5
libgcrypt 1.10.3
Copyright (C) 2024 g10 Code GmbH
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /Users/runner/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD[16](https://github.com/LizardByte/Sunshine/actions/runs/8651443319/job/23722157891#step:5:17)0, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

codecov/codecov-action#1371

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

5 participants