证书链中的自签名证书,而对于trapi项目运行npm i

问题描述

我正在尝试在公司笔记本电脑上设置Strapi项目。当我运行命令npm i时,它将安装一些模块,并在最终到达时

> sharp@0.26.2 install C:\<path>\Documents\Office\km-service\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

我得到这些错误

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-win32-x64.tar.brERR! sharp self signed certificate in certificate chain
sharp Attempting to build from source via node-gyp but this may fail due to the above error
sharp Please see https://sharp.pixelplumbing.com/install for required dependencies

C:\<path>\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\<path>\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\<path>AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
WARN install got an error,rolling back install
gyp ERR! configure error   
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34)
gyp ERR! stack     at TLSSocket.emit (events.js:210:5)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:794:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\<path>\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\<path>\node_modules\sharp

我尝试了以下操作,但问题尚未解决

npm config set registry http://registry.npmjs.org/
npm install npm -g --ca=null
npm config set ca=""
npm set strict-ssl false
npm set config set NODE_TLS_REJECT_UNAUTHORIZED=0

我在系统上安装了python 3.9.0,并且确实通过npm安装了Windows-build-tools。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)