Skip to content

I can not use any third lib in CloudCode. #6055

Closed
@fuqiangZ

Description

@fuqiangZ

[Questions]
I want to use third libraries in my cloud code of parse-server. I installed the dependencies in parse-server already, But when i use it in cloud code, error occurs as can not found the module.

[reproduced]
eg: I tryied to use mailgun in my CloudCode.

  1. install lib in parse-server,

npm install mailgun-js --save
check the package.json, "mailgun-js": "^0.22.0", exists

  1. require mailgun in cloudcode
var mailgun = require('mailgun-js')({apiKey: 'XXX', domain: 'XXX.com'});
Parse.Cloud.define("sendMail", (request, response) => {
});
  1. start the parse-server. Then error occurs:
Error: Cannot find module 'mailgun-js'
Require stack:
- /dilu_dev/gitlab/metis-cloudcode/okr/test.js
  • Server
    • parse-server : 3.7.2
    • Operating System: MacOS 13
    • Hardware: Mac
    • Localhost or remote server? : Local parse-server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions