PBIVIZ不承认证书

PBIVIZ not recognizing certificate

我一直在用最新的 pbiviz 东西更新我的开发环境 我做了一个:

npm i -g powerbi-visuals-tools

和:

pbiviz --install-cert

在 Windows terminal/powershell

然后我在 Visual Code 中打开了一个项目并使用终端做了一个:

pbiviz 包 info 建筑视觉... 信息正在安装 API:~3.8.0...

证书无效! 警告未找到本地有效证书。 信息正在检查 pbiviz 证书的全局实例...

warn 未找到有效 pbiviz 证书的全局实例。 信息正在生成新证书... 信息证书生成。位置是 C:\Users\mike\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\certs\PowerBICustomVisualTest_public.pfx。密码是“4492518445773821” info 开始准备插件模板 info 完成准备插件模板 错误 error:0308010C:digital 信封 routines::unsupported 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"); ^

错误:生成失败visualPlugin.ts 在 C:\Users\mike\AppData\Roaming\npm\node_modules\powerbi-visuals-tools\node_modules\powerbi-visuals-webpack-plugin\index.js:185:12 在异步 PowerBICustomVisualsWebpackPlugin._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 同样的问题

调试会话后,我们在 powerbi-visuals-tools@3.4.1 中发现一个错误,其中 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