facebook / facebook-business-sdk-codegen

Codegen project for our business SDKs
https://developers.facebook.com/docs/business-sdk
Other
87 stars 55 forks source link

Cannot run CodeGenerator.js #34

Open james10424 opened 3 years ago

james10424 commented 3 years ago

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

Goals

What do you want to achieve?

I want to run CodeGenerator.js as the README.md described. The command I used to run: npm run build && node lib/CodeGenerator.js python

Expected Results

What do you expect to happen? CodeGenerator.js successfully executed.

Actual Results

Error: ENOENT: no such file or directory, open '/Users/james/Downloads/programmation/sdk/servers/python/release/setup.py'

What actually happened? Can you provide a stack trace? It is not able to find the sdk folder. In fact, these are the folders named sdk: (find . -name "sdk" -type d) ./templates/java/examples/src/main/java/com/facebook/ads/sdk ./templates/java/src/main/java/com/facebook/ads/sdk

Also, it is trying to access the parent folder of the repo. (the cwd is: /Users/james/Downloads/programmation/facebook-business-sdk-codegen)

Taking a look at how this path is generated, the path is written inapi_specs/version_path.json, and src/common/Utils.js: loadDefaultSDKVersion went 3 directories back, but __dirname is facebook-business-sdk-codegen/lib/common.

Steps to Reproduce

What are the steps necessary to reproduce this issue? npm install && npm run build && node lib/CodeGenerator.js python

Code Samples & Details

Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the fix.

Note: Remember to format your code for readability:

npm install && npm run build && node lib/CodeGenerator.js python

dpalic commented 2 years ago

having the same issue here

either steps in documentation are missing, or I am doing something wrong. But basically only 2 steps are required from doc

kirsar commented 2 years ago

@dpalic yes, little bit of guidance is missing. I assume it assumes you have generated sdk already in related folder to get the "current" version. I'm investigating java sdk, so I just put the sdk into ...\sdk\servers\java\release\