remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development

Home Page:http://nodemon.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I need some assistance. it‘s not a bug but I didn't find the discussion tag. So I have to raise a question as an issue:does nodemon support running ts files?

Henrycheheng opened this issue · comments

commented

i remember a time when nodemon could run ts files,but today i use pnpm init a project, and tsc --init, and then execute an index.ts demo error as follows, how can I run ts file in nodemon
image

commented

The dependencies and configurations are shown below
image

commented

I've figured out what's wrong with this. If you put "type": "module" in package.json, it will give you this error, So nodemon could currently only run ts files under the commonjs modular specification?
image

commented

The observation I made was that the node code failed to validate the .ts file, resulting in an error being thrown.
image

Not sure if this is nodemon or something else (I don't regularly use TS and when I do, it's typically with Deno, so I don't have all the tooling to mess with).

The file you've included a screenshot at the end, that's not from nodemon is it?

Not sure if this a documentation issue or something else can be done… happy to take advice.

commented

Thank you for your reply. My last screenshot is indeed not an error caused by nodemon. In fact, node itself does not support ts files under esm. Thank you very much for your advice, I will give deno a try. Thank you again for your help,I have no more questions and I will close this issue soon.