node.js - Firebase 函数找不到模块 'cycle'

标签 node.js firebase npm package.json linux-mint

当我尝试运行任何 firebase 命令时出现此错误。

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

Error: Cannot find module 'cycle'
    at Function.Module._resolveFilename 
(internal/modules/cjs/loader.js:594:15)
    at Function.Module._load (internal/modules/cjs/loader.js:520:25)
    at Module.require (internal/modules/cjs/loader.js:650:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/firebase- tools/node_modules/winston/lib/winston/common.js:11:13)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)

我在

node.js 版本 v10.5.0

npm 版本 6.1.0

操作系统 Linux Mint 18.3

最佳答案

/usr/local/lib/node_modules/firebase-tools/node_modules 中的文件未按预期更新和安装。许多模块都丢失了。

我已将 firebase 本地安装到我将用作我的 firebase 目录的目录中。那里的所有模块。所以我将文件从本地 node_modules 文件夹复制到全局 node_modules 文件夹。

请注意,这是解决问题的绷带,因为任何时候您去更新 firebase 都需要重复此过程。

关于node.js - Firebase 函数找不到模块 'cycle',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51092606/

相关文章:

javascript - setState 不是一个函数

node.js - 有没有办法在不从本地驱动器打开每个项目的情况下删除所有 node_module?

node.js - 我在创建 react 应用程序时遇到错误,可能是由于我的 react 脚本中存在问题

javascript - 变量声明的 Mac 终端 Node REPL 输出

node.js - 在每个请求中包含承载 token 并保持用户登录

node.js - NodeJS REST API 模型和服务结构

flutter - 我正在尝试使用 Firebase 在 Flutter 中使用 google 注销,但它不起作用

firebase - 在 Firestore 中删除包含所有子集合和嵌套子集合的文档

macos - 使用 npm 1.3.11 安装 phonegap 创建密码 : directory path on Mac OSX

node.js - Mongoose填充如何将填充子文档加入到另一个集合