【问题标题】:firebase deploy Node "Warning: Accessing non-existent property"firebase 部署节点“警告:访问不存在的属性”
【发布时间】:2020-12-08 23:51:42
【问题描述】:

当我运行 firebase deploy 时,我收到此节点警告:

(node:14802) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

我尝试了firebase deploy --only hostingfirebase deploy --only functions 并得到相同的错误消息,所以这不是我的代码。

我跑node --trace-warnings ... 得到:

internal/modules/cjs/loader.js:1083
  throw err;
  ^

Error: Cannot find module '/Users'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1080:15)
    at Function.Module._load (internal/modules/cjs/loader.js:923:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

这似乎表明问题不在我的代码中。

我试用了 Node v14.8.0(最新)、v14.1.0 和 v12.8.5。

运行 firebase tools --version 我得到 6.3.1。最新版本是 8.7.0。我每周至少使用npm-check 更新我所有的 npm 包。我跑了npm i firebase-tools,它说它安装了8.7.0,但是当我运行firebase tools --version时,我仍然看到6.3.1。我还运行了npm install -g firebase-tools,它再次停留在 6.3.1。如何从 6.3.1 切换到 8.7.0?

package.jsonpackage-lock.json 说 8.7.0。

【问题讨论】:

  • 如果您有信息要添加到问题中,请使用“编辑”链接对其进行编辑,然后将信息添加到问题本身而不是添加 cmets。

标签: node.js firebase firebase-cli


【解决方案1】:

已修复!问题是firebase tools 卡在 6.3.1 上,尽管已定期更新并安装了 8.7.0。我跑了

curl -sL firebase.tools | upgrade=true bash

现在firebase tools --version 表示 8.7.0。

firebase deploy --only hosting 可以工作,但要让firebase deploy --only functions 工作,我必须进入functions 文件夹,打开package.json,然后进行更改

"engines": {
    "node": "8"
  },

"engines": {
    "node": "10"
  },

我不知道为什么定期更新 firebase tools 不起作用。

【讨论】:

  • 这为我修好了!
猜你喜欢
  • 2021-06-11
  • 2021-08-21
  • 1970-01-01
  • 2021-05-16
  • 1970-01-01
  • 2013-02-12
  • 1970-01-01
  • 1970-01-01
  • 2012-11-21
相关资源
最近更新 更多