question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Always prompt [ Must provide a command ], no matter how I call the command

See original GitHub issue

1.My environment:

Windows10
WebStorm2020.2.2
npm 6.13.4
node.js 12.16.1
ts-migrate 0.1.6

2.Error report & log


Administrator@TIONGEDESKTOP MINGW64 /d/Program_Files/JetBrains_ToolBox/projects/WebStorm/use-on-demand (master)
$ ts-migrate -- init aaa
Usage: npm run ts-migrate -- <command> [options]

Commands:
  npm run ts-migrate -- init <folder>       Initialize tsconfig.json file in
                                            <folder>
  npm run ts-migrate -- init:extended       Initialize tsconfig.json file in
  <folder>                                  <folder>
  npm run ts-migrate -- rename <folder>     Rename files in folder from JS/JSX
                                            to TS/TSX
  npm run ts-migrate -- migrate <folder>    Fix TypeScript errors, using
                                            codemods
  npm run ts-migrate -- reignore <folder>   Re-run ts-ignore on a project

Options:
  -h, --help  Show help                                                [boolean]

Examples:
  npm run ts-migrate -- --help              Show help
  npm run ts-migrate -- init frontend/foo   Create tsconfig.json file at
                                            frontend/foo/tsconfig.json
  npm run ts-migrate -- init:extended       Create extended from the base
  frontend/foo                              tsconfig.json file at
                                            frontend/foo/tsconfig.json
  npm run ts-migrate -- rename              Rename files in frontend/foo from
  frontend/foo                              JS/JSX to TS/TSX

Must provide a command.

3.Other Info

$ npm run ts-migrate -- migrate "./"
npm ERR! missing script: ts-migrate

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-09-28T03_56_16_853Z-debug.log

I did not manually add the [ts-migrate] script, because the [Repo Document] did not say to do so.

4._

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

14reactions
iaforekcommented, Sep 21, 2021

The help displayed by ts-config is terrible and misleading.

Obviously, running npm run ts-migrate won’t work also -- init <folder> or -- migrate <folder> suggests you must include two dash signs and space 😕 That’s not going to work either.

Solution: Use npx ts-migrate init <folder> or npx ts-migrate migrate <folder>, i.e. general format is: ts-migrate <command> <args> where the command is init, rename, migrate etc.

Please update help displayed!

4reactions
fillippeytoncommented, May 12, 2021

Use npx ts-migrate rename . --sources="path/to/folder/**/*" or Use npx ts-migrate migrate . --sources="path/to/folder/**/*"

You get the idea. . defines that the current folder is my project folder.

I was having an issue with running ts-migrate via npx like so: npx ts-migrate -- rename ., like it is documented in Github, but turns out -- is what was breaking for me. The above commands without -- worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bash ignoring error for a particular command - Stack Overflow
I have ~100 lines of script executing and I don't want to check return code of every line in the script. But for...
Read more >
UNIX Commands - E 115: Introduction to Computing ...
A command prompt is essentially as it sounds, the computer is prompting the user for command input.
Read more >
Bash - how to run a command after the previous finished?
I want to execute the commands one by one, when the previous finishes. Am I doing it in the right way? I've never...
Read more >
Command Line for Beginners – How to Use the Terminal Like ...
Hi everyone! In this article we'll take a good look at the command line (also known as the CLI, console, terminal or shell)....
Read more >
Command-line syntax overview for System.CommandLine
The [suggest] directive lets you search for commands when you don't know the exact command. .NET CLI Copy. dotnet [ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found