該賞金過期2天。此問題的答案有資格獲得 100聲望獎勵。 MikeAinOz想引起更多人對這個問題的關注:
我不需要完整的答案我只需要足夠的資訊來解決問題
我一直在用最新的 pbiviz 東西更新我的開發環境,我做了:
npm i -g powerbi-visuals-tools
和:
pbiviz --install-cert
在 Windows 終端/powershell 中
然后我在 Visual Code 中打開了一個專案并使用終端做了一個:
pbiviz 包資訊 構建視覺...資訊 正在安裝 API:~3.8.0...
證書無效!警告未找到本地有效證書。資訊正在檢查 pbiviz 證書的全域實體...
警告 未找到有效 pbiviz 證書的全域實體。info 正在生成新證書... info 證書已生成。位置是 C:\Users\mike\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\certs\PowerBICustomVisualTest_public.pfx。密碼是“4492518445773821”資訊開始準備插件模板資訊完成準備插件模板錯誤錯誤:0308010C:數字信封例程::不支持C:\Users\mike\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\powerbi -visuals-webpack-plugin\index.js:185 throw new Error("生成visualPlugin.ts失敗"); ^
錯誤:無法在 C:\Users\mike\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\powerbi-visuals-webpack-plugin\index.js:185:12 at async PowerBICustomVisualsWebpackPlugin 生成 visualPlugin.ts ._beforeCompile (C:\Users\mike\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\powerbi-visuals-webpack-plugin\index.js:177:4)
Node.js v17.0.0
我試過卸載,重新啟動和各種咒語,但它不想去。
我的證書真的無效嗎?我該如何檢查?我可以運行任何診斷程式嗎?欣然接受任何和所有建議
我剛剛更新到 pbiviz -V 3.4.1 同樣的問題
uj5u.com熱心網友回復:
在除錯會話之后,我們在 [email protected] 中發現了一個錯誤,其中certificatetoosl.js 中的證書檢查使用證書到期日期的文本日期,在我的情況下是 dd/mm/yyyy 失敗,因為這期望和 ISO 8601,但將使用 mm/dd/yyyy [![除錯影像][1]][1] 這是代碼:
// For Windows OS:
if (os.platform() === "win32") {
if (!fs.existsSync(pfxPath) || !passphrase) {
return false;
}
let certStr = await exec(`certutil -p ${passphrase} -dump "${pfxPath}"`);
let certStrSplitted = certStr.split('\r\n');
let regex = /(?<=: ).*/;
endDateStr = regex.exec(certStrSplitted[6]);
}
// For Linux and Mac/darwin OS:
else if (os.platform() === "linux" || os.platform() === "darwin") {
if (!fs.existsSync(certPath)) {
return false;
}
endDateStr = await exec(`openssl x509 -enddate -noout -in ${certPath} | cut -d = -f 2`);
}
let endDate = new Date(Date.parse(endDateStr));
verifyCertDate = (endDate - new Date()) > certSafePeriod;
if (verifyCertDate) {
ConsoleWriter.info(`Certificate is valid.`);
} else {
ConsoleWriter.warn(`Certificate is invalid!`);
removeCertFiles(certPath, keyPath, pfxPath);
}
我們沒有完整的解決方案,但在修復包之前會有解決方法。洗掉所有模塊并重新安裝似乎也解決了 visualPlugin.ts 問題。[1]:https : //i.stack.imgur.com/XVrsQ.png
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/339559.html
