请问一下,我的云函数突然不能本地调试了这是为什么?
发布于 7 年前 作者 uye 7219 次浏览 来自 问答

开启本地调试失败
worker for function code2 crashed with error code: 1 (Uncaught Fatal Exception)
加载执行入口文件失败,错误如下 Error: Cannot find module 'got'
Require stack:
- C:\Users\ASUS\WeChatProjects\miniprogram-16\cloudfunctions\code2\index.js
- C:\Users\ASUS\AppData\Roaming\Tencent\微信开发者工具\package.nw\js\common\cloud-functions-debugger-server\worker\node.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
at Function.Module._load (internal/modules/cjs/loader.js:527:27)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (C:\Users\ASUS\WeChatProjects\miniprogram-16\cloudfunctions\code2\index.js:3:11)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\ASUS\\WeChatProjects\\miniprogram-16\\cloudfunctions\\code2\\index.js',
'C:\\Users\\ASUS\\AppData\\Roaming\\Tencent\\微信开发者工具\\package.nw\\js\\common\\cloud-functions-debugger-server\\worker\\node.js'
]
}
z这是报错信息,上一秒还在测试,下一秒啥操作没有就开始报错
2 回复

当我去调用: const got = require('got')这条语句之后就开始无法调试

本地没有 npm install got

回到顶部