【问题标题】:Can't install @firebase/testing in firebase CLI无法在 firebase CLI 中安装 @firebase/testing
【发布时间】:2020-08-06 16:51:48
【问题描述】:

我正在使用 firebase CLI 测试我的云 Firestore 安全规则,在使用 npm install @firebase/testing --save-dev 安装 @firebase/testing 时收到以下错误-

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> core-js@3.6.5 postinstall E:\Coding\Web\poll-app firebase test\test\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

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

Error: Cannot find module 'E:\Coding\Web\poll-app firebase test\test\node_modules\core-js\-e'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:964:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1346:46)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1375:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm WARN test@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js@3.6.5 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the core-js@3.6.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

谁能告诉我应该怎么做?

【问题讨论】:

    标签: node.js firebase npm firebase-cli


    【解决方案1】:

    所以,我可以通过执行以下操作来修复它。我去了我的 Firebase 控制台,并从安全规则游乐场选项中打开了一个云外壳。加载后,我按照右侧面板上显示的学习助手给出的步骤,通过从 GitHub 克隆教程来设置我的云 shell。然后,我去了 quickstart-testing/cs-walkthrough/functions 并下载了 node_modules 文件夹。它被下载为 tar 文件。我以管理员权限运行 WinRAR 并提取了 tar 文件。它奏效了。我真的不明白它是如何以及为什么起作用的,但这就是我为解决问题所做的。

    【讨论】:

      猜你喜欢
      • 2018-07-02
      • 1970-01-01
      • 1970-01-01
      • 2018-06-29
      • 2021-06-16
      • 2021-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多