ts-migrate icon indicating copy to clipboard operation
ts-migrate copied to clipboard

Command Failed: npx tsc --init

Open marke-dev opened this issue 3 years ago • 3 comments

Using Yarn, deleted node_modules and such, reinstalled node_modules.
Entered npx tsc --init and seems to work

Here is part of the error I got

at checkExecSyncError (child_process.js:640:11) at Object.execSync (child_process.js:676:15) at Object.init [as default] (../node_modules/ts-migrate/build/commands/init.js:29:25) at Object.handler (../node_modules/ts-migrate/build/cli.js:22:19) at Object.runCommand (../node_modules/yargs/build/lib/command.js:196:48) at Object.parseArgs [as _parseArgs] (../node_modules/yargs/build/lib/yargs.js:1043:55) at Object.get [as argv] (../node_modules/yargs/build/lib/yargs.js:986:25) at Object. (../node_modules/ts-migrate/build/cli.js:180:58) at Module._compile (internal/modules/cjs/loader.js:1068:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)

marke-dev avatar Aug 04 '21 05:08 marke-dev

I had the same error and solved it by running npx tsc --init before npx -p ts-migrate -c "ts-migrate-full ."

flupke avatar Oct 27 '21 15:10 flupke

I had this too, I was running:

npx -p ts-migrate -c "ts-migrate-full src"

It seemed logical to target my src folder but apparently I should have given the real project root instead. I guess it knows to ignore node_modules.

Changing to

npx -p ts-migrate -c "ts-migrate-full ." made it work for me (after already having run npx tsc --init myself at project root)

daweimau avatar Nov 02 '21 10:11 daweimau

This also fixed the issue for me as well.

I was mistakenly running:

npx -p ts-migrate -c "ts-migrate-full <folder-name>"

instead of:

npx -p ts-migrate -c "ts-migrate-full ."

Much like @daweimau I also ran npx tsc --init beforehand. Thanks for creating this -- been trying to solve this for a bit now.

Ausiarm avatar Jul 19 '22 05:07 Ausiarm