"cloudfunction-config": {
"memorySize": 1024,
"concurrency":3,
"timeout": 6,
"triggers": [{
"name": "myTrigger",
"type": "timer",
"config": " 0 * * * * *"
}],
"path": "/DhHelp",
"runtime": "Nodejs16"
}
只要配置了这句后,本地运行就会报错。去掉就没问题。
xxxx\package.json: Unexpected token in JSON at position 242
17:09:29.599 [本地运行] at parse (<anonymous>)
17:09:29.599 [本地运行] at Module._extensions..json (node:internal/modules/cjs/loader:1440:39)
17:09:29.599 [本地运行] at Module.load (node:internal/modules/cjs/loader:1203:32)
17:09:29.599 [本地运行] at Module._load (node:internal/modules/cjs/loader:1019:12)
17:09:29.599 [本地运行] at Module.require (node:internal/modules/cjs/loader:1231:19)
17:09:29.599 [本地运行] at require (node:internal/modules/helpers:177:18)
17:09:29.599 [本地运行] at Module._compile (node:internal/modules/cjs/loader:1361:14)
T泰达T (作者)
{
"name": "dh_help",
"dependencies": {},
"extensions": {},
"cloudfunction-config": {
"memorySize": 1024,
"concurrency":3,
"timeout": 6,
"triggers": [{
"name": "myTrigger",
"type": "timer",
"config": " 0 *"
}],
"path": "/DhHelp",
"runtime": "Nodejs16"
}
}
2025-08-05 08:56
DCloud_uniCloud_CRL
回复 T泰达T: 你发的这个没有问题,确定是这个地方报的错吗?详细错误是什么?
2025-08-05 11:25
T泰达T (作者)
回复 DCloud_uniCloud_CRL: 我上面发的报错就是完整的,提示package.js报错,我测试就是删除掉cloudfunction-config就没问题了。上传到云端运行也没问题,就是本地报错。
2025-08-05 11:49