Firebase function Cannot find module 'cycle'

徘徊边缘 提交于 2019-12-23 10:57:49

问题


When I try to run any firebase command I get this error.

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)

I am on

node.js version v10.5.0

npm version 6.1.0

OS Linux Mint 18.3


回答1:


The files in /usr/local/lib/node_modules/firebase-tools/node_modules are not being updated and installed as expected. Many of the modules are missing.

I had installed firebase locally into what I am going to use as my firebase directory. All of the modules where there. So I copied the files from the local node_modules folder to the global node_modules folder.

To note, this is a bandage to the problem as anytime you go to update firebase you will need to repeat this process.



来源:https://stackoverflow.com/questions/51092606/firebase-function-cannot-find-module-cycle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!