执行 npm install -g argo-cli 时报错,未找到 OpenSSL 或者 Libgcrypt
shihaoH opened this issue · 2 comments
shihaoH commented
环境:M1Mac OS 12.6
执行 npm install -g argo-cli
提示
npm ERR! code 1
npm ERR! path /opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit
npm ERR! command failed
npm ERR! command sh -c -- node lifecycleScripts/preinstall
npm ERR! [nodegit] Running pre-install script
npm ERR! [nodegit] Configuring libssh2.
npm ERR! Error: Command failed: /opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl
npm ERR! configure: error: cannot find OpenSSL or Libgcrypt,
npm ERR! try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH
npm ERR!
npm ERR! at ChildProcess.exithandler (node:child_process:412:12)
npm ERR! at ChildProcess.emit (node:events:513:28)
npm ERR! at maybeClose (node:internal/child_process:1091:16)
npm ERR! at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
npm ERR! code: 1,
npm ERR! killed: false,
npm ERR! signal: null,
npm ERR! cmd: '/opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl'
npm ERR! }
npm ERR! configure: error: cannot find OpenSSL or Libgcrypt,
npm ERR! try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH
npm ERR!
npm ERR! [nodegit] ERROR - Could not finish preinstall
npm ERR! Error: Command failed: /opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl
npm ERR! configure: error: cannot find OpenSSL or Libgcrypt,
npm ERR! try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH
npm ERR!
npm ERR! at ChildProcess.exithandler (node:child_process:412:12)
npm ERR! at ChildProcess.emit (node:events:513:28)
npm ERR! at maybeClose (node:internal/child_process:1091:16)
npm ERR! at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
npm ERR! code: 1,
npm ERR! killed: false,
npm ERR! signal: null,
npm ERR! cmd: '/opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/opt/homebrew/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl'
npm ERR! }
已执行 brew install openssl
和 brew install libgcrypt
shihaoH commented
在 Linux 环境下也是同样的报错
环境:Centos 7.6.1810
npm ERR! code 1
npm ERR! path /usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit
npm ERR! command failed
npm ERR! command sh -c -- node lifecycleScripts/preinstall
npm ERR! [nodegit] Running pre-install script
npm ERR! [nodegit] Configuring libssh2.
npm ERR! Error: Command failed: /usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl
npm ERR! configure: error: in `/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2':
npm ERR! configure: error: no acceptable C compiler found in $PATH
npm ERR! See `config.log' for more details
npm ERR!
npm ERR! at ChildProcess.exithandler (node:child_process:402:12)
npm ERR! at ChildProcess.emit (node:events:513:28)
npm ERR! at maybeClose (node:internal/child_process:1100:16)
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
npm ERR! code: 1,
npm ERR! killed: false,
npm ERR! signal: null,
npm ERR! cmd: '/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl'
npm ERR! }
npm ERR! configure: error: in `/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2':
npm ERR! configure: error: no acceptable C compiler found in $PATH
npm ERR! See `config.log' for more details
npm ERR!
npm ERR! [nodegit] ERROR - Could not finish preinstall
npm ERR! Error: Command failed: /usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl
npm ERR! configure: error: in `/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2':
npm ERR! configure: error: no acceptable C compiler found in $PATH
npm ERR! See `config.log' for more details
npm ERR!
npm ERR! at ChildProcess.exithandler (node:child_process:402:12)
npm ERR! at ChildProcess.emit (node:events:513:28)
npm ERR! at maybeClose (node:internal/child_process:1100:16)
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
npm ERR! code: 1,
npm ERR! killed: false,
npm ERR! signal: null,
npm ERR! cmd: '/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/libssh2/configure --with-libssl-prefix=/usr/local/node/16.18.0/lib/node_modules/argo-cli/node_modules/nodegit/vendor/openssl/openssl'
npm ERR! }
MisterLuffy commented
npm i arco-cli -g
, arco ✅ / argo ❌