我正在嘗試匯入流行的庫phin(1M 下載/周)。然后我匯入該庫,并按照檔案中的說明使用它。我收到以下錯誤:p is not a function。
這是一個代碼沙箱示例,供您試用。
uj5u.com熱心網友回復:
我能夠在本地環境中重新創建錯誤并通過* as從匯入陳述句中洗掉來解決它。
代碼
import p from "phin";
// ^ removed * as
// a short iife for testing
(async () => {
let res = await p("https://google.com");
})()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/443525.html
標籤:javascript 节点.js
