當我嘗試部署我的 Firebase 函式時,它會出現決議錯誤。我在 Windows 上使用 cmd,我正在用 JavaScript 編碼。幾天前,我在 Mac 上部署了我的 Functions 并且它作業正常,今天我想在 Windows 上做同樣的事情。在我在 Windows 上嘗試它但它沒有作業之后,我再次在 mac 上嘗試它并沒有作業,即使它以前作業過。
我試圖將 firebase.json 從 "predeploy":[ "npm --prefix "$RESOURCE_DIR" run lint" ] 更改為:"predeploy": [ "npm --prefix "%RESOURCE_DIR%" run lint" ]
但這也不起作用。
有人可以幫我嗎?提前致謝 :)

uj5u.com熱心網友回復:
您需要更新 lint 檔案以考慮新的 ECMA 腳本。將ecmaVersion鍵值對添加到您的eslintrc.js檔案中。
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
parserOptions: {
"ecmaVersion": 2020, // add this
},
extends: [
"eslint:recommended",
"google",
]
};
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/443021.html
