windows - 尝试安装 aws-azure-login 时出现 Chromium 错误
问题描述
当我尝试在 Windows 10 上使用以下命令 npm install -g aws-azure-login 安装 aws-azure-login 时,我收到以下错误...
npm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead
npm ERR! code 1
npm ERR! path C:\Users\BUCS002\AppData\Roaming\npm\node_modules\aws-azure-login\node_modules\puppeteer
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! ERROR: Failed to set up Chromium r818858! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
npm ERR! Error: self signed certificate in certificate chain
npm ERR! at TLSSocket.onConnectSecure (node:_tls_wrap:1531:34)
npm ERR! at TLSSocket.emit (node:events:378:20)
npm ERR! at TLSSocket._finishInit (node:_tls_wrap:945:8)
npm ERR! at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:719:12) {
npm ERR! code: 'SELF_SIGNED_CERT_IN_CHAIN'
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\BUCS002\AppData\Local\npm-cache\_logs\2021-03-31T21_18_10_823Z-debug.log
我还在日志中获得了这些附加信息......
922 verbose stack Error: command failed
922 verbose stack at ChildProcess.<anonymous> (C:\Users\BUCS002\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
922 verbose stack at ChildProcess.emit (node:events:378:20)
922 verbose stack at maybeClose (node:internal/child_process:1067:16)
922 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
923 verbose pkgid puppeteer@5.5.0
924 verbose cwd C:\Program Files\Cmder
925 verbose Windows_NT 10.0.18363
926 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\BUCS002\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "aws-azure-login"
927 verbose node v15.11.0
928 verbose npm v7.7.6
有什么想法可以解决这个问题吗?
解决方案
引擎盖下aws-azure-login
正在使用puppeteer
,它依赖于chromium
,为了能够使用它,你必须先安装它,比如
node C:\Users\user.name\AppData\Roaming\npm\node_modules\aws-azure-login\node_modules\puppeteer\install.js
替换路径中的用户名,该命令将在此处安装所需的 Chromium 版本
C:\Users\user.name\AppData\Roaming\npm\node_modules\aws-azure-login\node_modules\puppeteer\.local-chromium\
推荐阅读
- node.js - 为什么我的 Heroku API 应用程序不返回 json 数据?
- html - 在没有 flex 的情况下在一行中对齐 Div,因为它会弄乱高度(Bootstrap)
- apache-spark - 在 PySpark 中转换数据框模式
- python - 操作许多不同绘图的 matplotlib 图形组件的最有效方法是什么?
- c# - WPF 滑块可在单击时更改按钮颜色
- python - 如何在熊猫图中增加 xticks 的大小
- xml - 第二次创建片段时,片段中的视图相互重叠
- python - python - 如何指示参数应该是对python类型中派生类的引用?
- javascript - JavaScript在localStorage中存储整数,增加值并渲染数据
- apache-spark - Spark:UDF中的访问行