Skip to content

Error : spawn gpg ENOENT #27

Open
Open

Description

@taeverapon32

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' ] }

Activity

  1. satheeshtcs commented on Feb 7, 2018

    @satheeshtcs

    any solution for the above issue?

  2. freewil commented on Feb 7, 2018

    @freewil
    Collaborator

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

  3. satheeshtcs commented on Feb 7, 2018

    @satheeshtcs

    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.

  4. freewil commented on Feb 7, 2018

    @freewil
    Collaborator

    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.

  5. satheeshtcs commented on Feb 8, 2018

    @satheeshtcs

    @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?

  6. satheeshtcs commented on Feb 9, 2018

    @satheeshtcs

    @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?

  7. rjain3 commented on Feb 9, 2021

    @rjain3

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

  8. ReenigneArcher commented on Apr 11, 2024

    @ReenigneArcher

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions