facebook-business-sdk-codegen icon indicating copy to clipboard operation
facebook-business-sdk-codegen copied to clipboard

Cannot run CodeGenerator.js

Open james10424 opened this issue 3 years ago • 2 comments

Checklist

  • [x] I've updated to the latest released version
  • [x] I've searched for existing GitHub issues
  • [x] I've looked for existing answers on Stack Overflow and the Facebook Developers Group
  • [x] I've read the Code of Conduct
  • [x] This issue is not security related and can safely be disclosed publicly on GitHub

Environment

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

  • Node Version: 15.14.0
  • NPM Version: 7.7.6

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

james10424 avatar Sep 15 '21 21:09 james10424

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

dpalic avatar Jun 10 '22 05:06 dpalic

@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\

kirsar avatar Jun 16 '22 17:06 kirsar