我正在使用GitLab的无服务器框架模板,并试图首先在本地运行测试,方法是创建一个子的无服务器脱机进程。我得到的错误‘产卵无服务器ENOENT’时,执行玩笑测试。知道为什么吗?
let useLocalService = true
...
let serverlessProcess = {
serverless_process: null,
start: async () => {
if(useLocalService) {
this.serverless_process = spawn('serverless', ['offline', '--port', 3000])
}
},
stop: () => {
if(useLocalService) {
this.serverless_process.kill('SIGINT')
}
}
}describe('hello', () => {
beforeAll(async () => {
// serverlessProcess.start starts serverless offline in a child process
// unless the test is pointed at a deployed service
await serverlessProcess.start()
})
afterAll(() => {
// serverlessProcess.stop kills the child process at the end of the test
// unless the test is pointed at a deployed service
serverlessProcess.stop()
})
it(...我收到的唯一错误信息是:
● Test suite failed to run
spawn serverless ENOENT发布于 2022-02-28 04:52:31
您是否试图在本地启动任何AWS服务?
如果您试图使用任何导致错误的AWS插件。
确保Java是本地正在尝试的installed
sls dynamodb install如果仍然面临问题,则通过启用调试export SLS_DEBUG=true检查无服务器本地问题。
https://stackoverflow.com/questions/70730284
复制相似问题