Error: ts-node-dev not found
im trying to put my application developed with nodejs+express and im get error of the ts-node-dev.
52 Replies
Project ID:
N/A
use npx or yarn as the prefix in the start script
npx ts-node-dev src/server.ts
ok
im getting the same error 😦
are you deploying on production with ts-node-dev? if yes i wouldn't recommend
what do you recommend?
ts-node
ok
im modifying
now im getting this error
@thallescomh @medim
i recommend building the project and shipping just the javascript.
btw is your project on github? i can take a look
Railway can do the building process too, but its probably an API so theres no 'build'
do u have an
.npmrc
file at root?is a API
I dont have .npmrc
Did u install
ts-node
package and changed the start command to ts-node
instead of ts-node-dev
?yes!
send your package.json here pls
hmm it seems you still have the railway.json
you don't need the railway json btw, railway hands everything by default
hm!
yep, its the railway.json start command that is causing this error
didn't see it at first
im removing
ok
one moment
same error
send me your railway.json updated
or did you deleted?
ah ok you deleted
yes!
click in your deployment -> details, and then send me a screenshot
I need to enter the right commands?
it's still deploying, are you sure it's the same error?
disappeared after I removed the railway.json file
one moment
it worked out!
nice!
🔥
this is a front end messing with the backend
u can use
ts-node --transpile-only urfile.ts
in prod to reduce memory footprint
since it will not generate type infocan you give me an example?
in ur start command
Solution
npx ts-node --transpile-only src/server.ts
thats an API
yes i can't consume
it prob wont work on the web cause it got nothing on that
/
endpoint i guess
do u have any ENV VAR configured in railway?yes
error disappeared without me doing anything kk
I would say to make a PORT var if u dont got one yet in ur env vars and assign it to the port ur api is using
PORT=5796
in this caseIs this not automatic?
It normally is
this is one problem?
Not a problem, just a warning
cause ur installing
devDependencies
on a supposed production build
but u prob need those devDependencies
yes!
thanks man
np
@lucaslima8925 Right click this message i'm mentioning -> Apps -> Mark Solution
So others can see it
😄