本文目录

Npm openssl sha file not found include

🌙
手机阅读
本文目录结构

mac openssl sha.h file not found include .md

build Electron 项目时候遇到的错误

 OKAY  take it away `electron-builder`

  • electron-builder version=19.56.2
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=build/electron-builder.yaml
  • rebuilding native production dependencies platform=darwin arch=x64
Error: /usr/local/bin/node exited with code 1
Output:

> argon2@0.19.3 install /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/argon2
> node-gyp rebuild

  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
  SOLINK_MODULE(target) Release/argon2.node

> ed25519@0.0.4 install /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/ed25519
> node-gyp rebuild

  CC(target) Release/obj.target/ed25519/src/ed25519/keypair.o

Error output:
../src/ed25519/keypair.c:2:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
         ^~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/ed25519/src/ed25519/keypair.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/ed25519
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ed25519@0.0.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ed25519@0.0.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/broszhu/.npm/_logs/2018-09-29T02_31_39_815Z-debug.log

    at ChildProcess.childProcess.once.code (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/builder-util/src/util.ts:241:14)
    at Object.onceWrapper (events.js:318:30)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
From previous event:
    at spawn (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/builder-util/src/util.ts:200:3)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/src/util/yarn.ts:171:5
From previous event:
    at rebuild (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/out/util/yarn.js:93:22)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/src/util/yarn.ts:20:11
    at Generator.next (<anonymous>)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
    at installOrRebuild (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/out/util/yarn.js:31:21)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/src/packager.ts:442:7
    at Generator.next (<anonymous>)
From previous event:
    at Packager.installAppDependencies (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/out/packager.js:496:11)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/src/packager.ts:356:20
    at Generator.next (<anonymous>)
From previous event:
    at Packager.doBuild (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/out/packager.js:432:11)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/src/packager.ts:308:52
    at Generator.next (<anonymous>)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/graceful-fs/graceful-fs.js:99:16
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at Packager._build (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/out/packager.js:376:11)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/src/packager.ts:270:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
    at Packager.build (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder-lib/out/packager.js:332:11)
    at /Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/src/builder.ts:310:40
    at Generator.next (<anonymous>)
From previous event:
    at _build (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/out/builder.js:61:21)
    at build (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/src/builder.ts:280:10)
    at then (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/src/cli/cli.ts:48:33)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
    at Object.args [as handler] (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/out/cli/cli.js:121:117)
    at Object.runCommand (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/node_modules/yargs/yargs.js:1042:24)
    at Object.get [as argv] (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/node_modules/yargs/yargs.js:957:21)
    at Object.<anonymous> (/Users/broszhu/Documents/wifisong-test/canonchain-wallet/node_modules/electron-builder/out/cli/cli.js:117:439)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! czr-wallet@0.1.2 build: `node .electron-vue/build.js && electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the czr-wallet@0.1.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/broszhu/.npm/_logs/2018-09-29T02_31_39_903Z-debug.log

核心错误:

Error output:
../src/ed25519/keypair.c:2:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>

需要下面这样操作

$ cd /usr/local/include
$ ln -s ../opt/openssl/include/openssl .

AXIHE / 精选资源

浏览全部教程

面试题

学习网站

前端培训
自己甄别

前端书籍

关于朱安邦

我叫 朱安邦,阿西河的站长,在杭州。

以前是一名平面设计师,后来开始接接触前端开发,主要研究前端技术中的JS方向。

业余时间我喜欢分享和交流自己的技术,欢迎大家关注我的 Bilibili

关注我: Github / 知乎

于2021年离开前端领域,目前重心放在研究区块链上面了

我叫朱安邦,阿西河的站长

目前在杭州从事区块链周边的开发工作,机械专业,以前从事平面设计工作。

2014年底脱产在老家自学6个月的前端技术,自学期间几乎从未出过家门,最终找到了满意的前端工作。更多>

于2021年离开前端领域,目前从事区块链方面工作了