微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决证书链中的自签名证书,而对于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 举报,一经查实,本站将立刻删除。