微信小程序error message Cannot find module 'wx-server-sdk'; at cloud.callFunction api;

出现如下错误:
WAService.js:4 Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail cloud function service error code -504002, error message Cannot find module ‘wx-server-sdk’; at cloud.callFunction api;

 解决办法:
到https://nodejs.org/en/下载node.js安装.
命令行CMD来到云函数的本地目录下

运行命令安装
npm install --save wx-server-sdk@latest

出现该文件,重新上传部署即可

在这里插入图片描述

发布了149 篇原创文章 · 获赞 111 · 访问量 16万+

猜你喜欢

转载自blog.csdn.net/qq_41076797/article/details/103312808