Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running tool in Windows #392

Open
russell-knight opened this issue Apr 29, 2024 · 1 comment
Open

Error running tool in Windows #392

russell-knight opened this issue Apr 29, 2024 · 1 comment

Comments

@russell-knight
Copy link

Steps to reproduce

  • run npx types-react-codemod preset-18 ./src
  • select only the implicit-children option from the list and press enter
image

Error

C:\src\my-repo [main ≡]> types-react-codemod preset-18 ./src
? Pick transforms to apply implicit-children
executing "node C:\Users\<USERNAME>\AppData\Local\pnpm\global\5\.pnpm\jscodeshift@0.15.2_@babel+preset-env@7.24.4\node_modules\jscodeshift\bin\jscodeshift.js --extensions=tsx,ts "--ignore-pattern=**/node_modules/**" --no-babel --transform C:\Users\<USERNAME>\AppData\Local\pnpm\global\5\.pnpm\types-react-codemod@3.3.0\node_modules\types-react-codemod\transforms\preset-18.js --preset18Transforms="implicit-children" ./src"
C:\Users\<USERNAME>:1
[86E8:7E80][2024-01-23T09:33:11]i001: Burn v3.10.4.4718, Windows v10.0 (Build 22621: Service Pack 0), path: C:\Windows\Temp\{EB641E8C-7D35-481E-BDCF-7885DDDB1613}\.cr\VC_redist.x64.exe
     ^

SyntaxError: Unexpected token ':'
    at internalCompileFunction (node:internal/vm:77:18)
    at wrapSafe (node:internal/modules/cjs/loader:1288:20)
    at Module._compile (node:internal/modules/cjs/loader:1340:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

Node.js v20.10.0
types-react-codemod <codemod> <paths...>

Positionals:
  codemod  [string] [required] [choices: "context-any", "deprecated-legacy-ref",
                        "deprecated-prop-types-types", "deprecated-react-child",
                     "deprecated-react-fragment", "deprecated-react-node-array",
     "deprecated-react-text", "deprecated-react-type", "deprecated-sfc-element",
                             "deprecated-sfc", "deprecated-stateless-component",
                      "deprecated-void-function-component", "implicit-children",
                    "no-implicit-ref-callback-return", "preset-18", "preset-19",
          "react-element-default-any-props", "refobject-defaults", "scoped-jsx",
                          "useCallback-implicit-any", "useRef-required-initial"]
  paths                                                      [string] [required]

Options:
  --version         Show version number                                [boolean]
  --help            Show help                                          [boolean]
  --dry                                               [boolean] [default: false]
  --ignore-pattern                      [string] [default: "**/node_modules/**"]
  --verbose                                           [boolean] [default: false]

Examples:
  types-react-codemod preset-18 ./          Ignores `node_modules` and `build`
  --ignore-pattern                          folders
  "**/{node_modules,build}/**"

Error: Command failed: node C:\Users\<USERNAME>\AppData\Local\pnpm\global\5\.pnpm\jscodeshift@0.15.2_@babel+preset-env@7.24.4\node_modules\jscodeshift\bin\jscodeshift.js --extensions=tsx,ts "--ignore-pattern=**/node_modules/**" --no-babel --transform C:\Users\<USERNAME>\AppData\Local\pnpm\global\5\.pnpm\types-react-codemod@3.3.0\node_modules\types-react-codemod\transforms\preset-18.js --preset18Transforms="implicit-children" ./src   
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at Object.handler (C:\Users\<USERNAME>\AppData\Local\pnpm\global\5\.pnpm\types-react-codemod@3.3.0\node_modules\types-react-codemod\bin\types-react-codemod.cjs:131:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 7100,
  stdout: null,
  stderr: null
}
@eps1lon
Copy link
Owner

eps1lon commented Apr 29, 2024

What does node --version say for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants