ts-migrate
ts-migrate copied to clipboard
Command Failed: npx tsc --init
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.
I had the same error and solved it by running npx tsc --init
before npx -p ts-migrate -c "ts-migrate-full ."
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)
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.