我在 js 程式碼中使用 xlsx。從去年開始就運(yùn)作良好。今天我開始遇到問題並且建置失敗。由於:
$ yarn audit: yarn audit v1.22.19 ┌───────────────────────────────────────────────────────────────────────────── │ moderate: Prototype Pollution in sheetJS ├───────────────────────────────────────────────────────────────────────────── │ Package: xlsx ├───────────────────────────────────────────────────────────────────────────── │ Patched in: >=0.19.3 ├───────────────────────────────────────────────────────────────────────────── │ Dependency of: xlsx ├───────────────────────────────────────────────────────────────────────────── │ Path: xlsx ├───────────────────────────────────────────────────────────────────────────── │ More info: https://www.npmjs.com/advisories/1091817 └─────────────────────────────────────────────────────────────────────────────
很明顯,解決方案是升級到版本 0.19.3 或更高版本,但最新版本是 0.18.5,因?yàn)椋篽ttps://www.npmjs.com/package/xlsx?activeTab=readme。
有什麼辦法可以解決這個問題嗎?
如 README 所述,該專案不再在 GitHub 上維護(hù),也不再發(fā)佈到 npm。嘗試從以下連結(jié)安裝: https://cdn.sheetjs .com/xlsx-0.19.3/xlsx-0.19.3.tgz。在您的 package.json 檔案中加入以下內(nèi)容:
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"