let privateKey = fs.readFileSync('./apiclient_key.pem').toString('ascii');
云函数里,本地调试没有任何问题,上传后远端调试就报下面的错,我到服务端看文件都传上去了啊,应该是上面这句读取私钥文件报错
Error: EACCES: permission denied, open './apiclient_key.pem'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at app.router (/var/user/index.js:505:27)
at dispatch (/var/user/node_modules/tcb-router/src/index.js:167:40)
at /var/user/node_modules/tcb-router/src/index.js:142:16
at Promise (/var/user/node_modules/tcb-router/src/index.js:106:17)
at new Promise (<anonymous>)
at TcbRouter.serve (/var/user/node_modules/tcb-router/src/index.js:105:20)
at EventHandler.exports.main [as realHandler] (/var/user/index.js:529:14)
at EventHandler.handle (/var/runtime/node8/bootstrap.js:402:28)
at invoke (/var/runtime/node8/bootstrap.js:205:22)
at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:137:9)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
请参考https://developers.weixin.qq.com/community/develop/doc/000c084a8183c01c616cfab945fc00 重置文件夹权限
没有权限打开那个文件
我也遇到类似权限问题。
1年多了,也没官方回应吗?