create-react-appのプロジェクト内でts-nodeが立ち上がらない
react掲題の通り。
<repl>.ts:1:1 - error TS1208: '<repl>.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
というエラーが出てた。書いてある通りなので、このオプションを無効にする。起動引数でtsconfig.json
を上書きするには、-O
オプションを渡す
npx ts-node -O '{"isolatedModules: false"}'
追記
↑これで起動するかと思ったら、結局エラーが出てダメだったよ。