キ
Size: a a a
キ
IE
node index.js
и tsc тогда не нужен, просто файл ему указываешь сразу ts-ныйts-node src/index
Unknown file extension ".ts" for /home/projects/myBot/src/index.ts
キ
echo "const foo: string = 'foo'; const bar: number = 45; console.log(foo, bar);" > test.ts && ts-node test.ts
IE
echo "const foo: string = 'foo'; const bar: number = 45; console.log(foo, bar);" > test.ts && ts-node test.ts
キ
IE
el
ts-node src/index
Unknown file extension ".ts" for /home/projects/myBot/src/index.ts
ts-node src/index
это без расширения указываешь? а если с расширением указать - тоже не работает?IE
ts-node src/index
это без расширения указываешь? а если с расширением указать - тоже не работает?キ
キ
Remove "type": "module" from package.json
キ
IE
Remove "type": "module" from package.json
キ
IE
~/projects/myBot$ ts-node src/index.ts
(node:18017) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/projects/myBot/src/index.ts:2
import { Factory, Type } from "./classes/index";
^^^^^^
SyntaxError: Cannot use import statement outside a module
キ
キ
キ
キ