Skip to content

yarn generate-clients -m throws TypeError [ERR_INVALID_ARG_TYPE] #1312

@trivikr

Description

@trivikr

Describe the bug
yarn generate-clients -m throws TypeError [ERR_INVALID_ARG_TYPE]

SDK version number
master

Details of the browser/Node.js version

$ node -v
v14.2.0

To Reproduce (observed behavior)

  • Create a temporary directory
    $ mkdir ~/Downloads/temp
  • Copy a model to that directory
    $ cp codegen/sdk-codegen/aws-models/s3.2006-03-01.json ~/Downloads/temp
  • Run yarn generate-clients on the temporary directory
    $ yarn generate-clients -m ~/Downloads/temp 

Error thrown:

yarn run v1.22.4
$ node ./scripts/generate-clients -m /home/trivikr/Downloads/temp
preparing models from /home/trivikr/Downloads/temp...
copying model s3.2006-03-01.json...
TypeError [ERR_INVALID_ARG_TYPE]: The "mode" argument must be integer. Received an instance of Object
    at copyFileSync (fs.js:1905:10)
    at generateClients (/local/home/trivikr/workspace/aws-sdk-js-v3/scripts/generate-clients/code-gen.js:23:7)
    at /local/home/trivikr/workspace/aws-sdk-js-v3/scripts/generate-clients/index.js:36:11
    at Object.<anonymous> (/local/home/trivikr/workspace/aws-sdk-js-v3/scripts/generate-clients/index.js:57:3)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior
yarn generate-clients -m succeeds

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