Похожие чаты

Do you know how to fix it? if i add

/src/ in my readFile string it works but i dont want to resolve like this, why am i forced to use specify src?

I start my app with

npx ts-node-dev --respawn --transpile-only src/test.ts

18 ответов

7 просмотров

Because readFile is relative to your current working directory

Filiberto- Автор вопроса

Is this command ran after cd'ing into src?

Filiberto- Автор вопроса
Thomas
Is this command ran after cd'ing into src?

i just use it to compile my ts file

Filiberto
i just use it to compile my ts file

So your current working directory is not src

Filiberto- Автор вопроса
Thomas
So your current working directory is not src

how can i tell to ts to consider src as my working dir?

Filiberto
???

I think use process.cwd() in the readFile instead of ./

Filiberto- Автор вопроса
David
I think use process.cwd() in the readFile instead ...

can i do something wiht typescript config?

Filiberto
can i do something wiht typescript config?

I think that is completely unrelated to readFile. the tsconfig stuff is for telling the compiler where to look when it builds the ts into js

Filiberto- Автор вопроса

.

Filiberto
.

// tconfig.json { "compilerOptions": { "rootDir": "src", ... "ts-node": { "transpileOnly": true, "files": true, "compilerOptions": { "rootDir": "." } } }

Filiberto
how can i tell to ts to consider src as my working...

cd src && npx ts-node-dev --respawn --transpile-only test.ts

Filiberto- Автор вопроса
Filiberto- Автор вопроса
Thomas
cd src && npx ts-node-dev --respawn --transpile-on...

it works but i dont want to go inside src, like this

Filiberto
it works but i dont want to go inside src, like th...

That's what "current working directory" means

Filiberto- Автор вопроса
Thomas
That's what "current working directory" means

shouldn't be related to the file where Im writing the code?

Похожие вопросы

Обсуждают сегодня

$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
'frakturBold' => ['𝖆', '𝖇', '𝖈', '𝖉', '𝖊', '𝖋', '𝖌', '𝖍', '𝖎', '𝖏', '𝖐', '𝖑', '𝖒', '𝖓', '𝖔', '𝖕', '𝖖', '𝖗', '𝖘', '𝖙', '𝖚', '𝖛', '𝖜', '𝖝', '𝖞', '𝖟', '𝕬', '𝕭', '𝕮', '𝕯'...
Roma
4
И ещё вопрос: можно ли типа как на дос как-то запариться и с помощью прерываний выводить текст, вместо функции printf ?
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
34
Ладно, ещё тупого спрошу. Код должен банально вывести значение регистра на консоль, на деле же не выводя ничего, просто оставляя нерабочую консоль (открыта, ничего не написан...
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
25
How did we have so many dormant scammers in here? Who are these people. It’s been years. We know each other. If you dm me “I’ve been an og” but haven’t said a single word her...
Justin | LGCY |
49
Right? Every new partnership just makes $Fun stronger and more appealing.
Brian
18
Let me insert my "5++" kilocents into how zcash should be positioned (and how it would have been positioned/adopted from day one). You are allowed to believe or not believe in...
eBiker
5
здравствуйте. пытаюсь проверить, содержится ли в десятичном представлении инта некоторая цифра. совершаю: strstr(x, "5") != NULL) получаю ошибку с фото (заведомо неработающий ...
Катя Шевчук🪇
18
привет всем, подскажите, пожалуйста, где в Манагуа оплачивать штраф за overstay? слышала, что в аэропорту и что надо именно в кордобах
Aisuluu
16
Who else is expecting some big news from the team this week?
Trivixx
14
Карта сайта