自学内容网 自学内容网

小程序云函数调用失败Cannot find module ‘wx-server-sdk‘

1.报错:

        errMsg: Runtime.ImportModuleError: Error: Cannot find module 'wx-server-sdk'

2.需安装:

        npm install --save wx-server-sdk@latest

3.报错:

        rollbackFailedOptional: verb npm-session

4.检查版本:

        npm -v

5.更新版本

        5.1.如果您的 npm 版本过旧,更新 npm:

                npm install -g npm@latest

        5.2.如果您使用的是全局安装的 npm,更新 npm:

                npm install npm@latest

        5.3如果以上命令无法更新,使用淘宝镜像:

                npm config set registry https://registry.npm.taobao.org

6.以上都不行

        6.1运行npm install

        6.2package.json

        {

                "dependencies" :{

                        "wx-server-sdk":"*"

                       }

        }


原文地址:https://blog.csdn.net/u013095066/article/details/135658835

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!