问题描述
尝试启动并运行Firebase仿真器套件以对我的功能进行本地测试。
首先,如果我部署了函数,它们就会部署并运行良好,因此将其排除在根本原因之外。
问题: 启动模拟器时,出现错误
⚠ Error: Cannot find module './lib/psSupported'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/jsachs/entwicklung/tcBlue-FreightWeight/firebase/functions/node_modules/jsonwebtoken/verify.js:6:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
⚠ We were unable to load your functions code. (see above)
admin.initializeApp();
同样,这些功能可以部署并正常工作,所以我排除了根本原因。 我认为这是在本地系统上安装的东西。 我从头开始。 已安装
npm v10
npm install firebase-functions@latest firebase-admin@latest --save
npm install -g firebase-tools
npm install mocha --save-dev
npm install @firebase/testing --save-dev
检查了有关运行仿真器的文档,但没有找到缺失的位置。
仿真器启动的完整日志:
>firebase emulators:start
i emulators: Starting emulators: auth,functions,database,hosting
⚠ functions: The following emulators are not running,calls to these services from the Functions emulator will affect production: firestore,pubsub
✔ functions: Using node@10 from host.
i database: Database Emulator logging to database-debug.log
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
i ui: Emulator UI logging to ui-debug.log
i functions: Watching "/home/jsachs/entwicklung/tcBlue-FreightWeight/firebase/functions" for Cloud Functions...
⚠ Error: Cannot find module './lib/psSupported'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/jsachs/entwicklung/tcBlue-FreightWeight/firebase/functions/node_modules/jsonwebtoken/verify.js:6:25)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
⚠ We were unable to load your functions code. (see above)
没有更多的输出,直到我停止模拟器。
firebase --version
8.14.1
npm --version
6.14.8
node --version
v10.21.0
OS is opensuse 15.1 in case it matters
任何人抬头,欢迎深入探讨问题所在。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)