我是linux和stackoverflow的新手,所以我来这里寻求帮助 . 这是我尝试使用 sudo npm install canvas 安装canvas时得到的错误日志:

ursa@0.9.4 install /home/oem/git/vembly/node_modules/ursa

node-gyp rebuild

gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1116:38)
gyp ERR! stack     at emitNone (events.js:106:13)
gyp ERR! stack     at TLSSocket.emit (events.js:208:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:643:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38)
gyp ERR! System Linux 4.15.0-42-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/oem/git/vembly/node_modules/ursa
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

> canvas@1.6.13 install /home/oem/git/vembly/node_modules/canvas
> node-gyp rebuild

gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: unable to get local issuer certificate
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1116:38)
gyp ERR! stack     at emitNone (events.js:106:13)
gyp ERR! stack     at TLSSocket.emit (events.js:208:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:643:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:473:38)
gyp ERR! System Linux 4.15.0-42-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/oem/git/vembly/node_modules/canvas
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok


npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 (node_modules/ursa):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.6.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above