R
Railway•16mo ago
lucaslima

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.
Solution:
npx ts-node --transpile-only src/server.ts
Jump to solution
52 Replies
Percy
Percy•16mo ago
Project ID: N/A
Medim
Medim•16mo ago
use npx or yarn as the prefix in the start script npx ts-node-dev src/server.ts
lucaslima
lucaslimaOP•16mo ago
ok im getting the same error 😦
ThallesComH
ThallesComH•16mo ago
are you deploying on production with ts-node-dev? if yes i wouldn't recommend
lucaslima
lucaslimaOP•16mo ago
what do you recommend?
Medim
Medim•16mo ago
ts-node
lucaslima
lucaslimaOP•16mo ago
ok im modifying
lucaslima
lucaslimaOP•16mo ago
now im getting this error
lucaslima
lucaslimaOP•16mo ago
@thallescomh @medim
ThallesComH
ThallesComH•16mo ago
i recommend building the project and shipping just the javascript. btw is your project on github? i can take a look
Medim
Medim•16mo ago
Railway can do the building process too, but its probably an API so theres no 'build' do u have an .npmrc file at root?
lucaslima
lucaslimaOP•16mo ago
is a API I dont have .npmrc
Medim
Medim•16mo ago
Did u install ts-node package and changed the start command to ts-node instead of ts-node-dev?
lucaslima
lucaslimaOP•16mo ago
yes!
ThallesComH
ThallesComH•16mo ago
send your package.json here pls
lucaslima
lucaslimaOP•16mo ago
lucaslima
lucaslimaOP•16mo ago
"ts-node": "^10.9.1",
"ts-node": "^10.9.1",
ThallesComH
ThallesComH•16mo ago
hmm it seems you still have the railway.json you don't need the railway json btw, railway hands everything by default
lucaslima
lucaslimaOP•16mo ago
hm!
Medim
Medim•16mo ago
yep, its the railway.json start command that is causing this error didn't see it at first
lucaslima
lucaslimaOP•16mo ago
im removing
ThallesComH
ThallesComH•16mo ago
ok
lucaslima
lucaslimaOP•16mo ago
one moment same error
ThallesComH
ThallesComH•16mo ago
send me your railway.json updated or did you deleted? ah ok you deleted
lucaslima
lucaslimaOP•16mo ago
yes!
ThallesComH
ThallesComH•16mo ago
click in your deployment -> details, and then send me a screenshot
lucaslima
lucaslimaOP•16mo ago
lucaslima
lucaslimaOP•16mo ago
I need to enter the right commands?
ThallesComH
ThallesComH•16mo ago
it's still deploying, are you sure it's the same error?
lucaslima
lucaslimaOP•16mo ago
disappeared after I removed the railway.json file one moment
lucaslima
lucaslimaOP•16mo ago
it worked out!
ThallesComH
ThallesComH•16mo ago
nice!
Medim
Medim•16mo ago
🔥
lucaslima
lucaslimaOP•16mo ago
this is a front end messing with the backend kekw
Medim
Medim•16mo ago
u can use ts-node --transpile-only urfile.ts in prod to reduce memory footprint since it will not generate type info
lucaslima
lucaslimaOP•16mo ago
can you give me an example?
Medim
Medim•16mo ago
in ur start command
Solution
Medim
Medim•16mo ago
npx ts-node --transpile-only src/server.ts
lucaslima
lucaslimaOP•16mo ago
Medim
Medim•16mo ago
thats an API
lucaslima
lucaslimaOP•16mo ago
yes i can't consume
Medim
Medim•16mo ago
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?
lucaslima
lucaslimaOP•16mo ago
yes error disappeared without me doing anything kk
Medim
Medim•16mo ago
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 case
lucaslima
lucaslimaOP•16mo ago
Is this not automatic?
Medim
Medim•16mo ago
It normally is
lucaslima
lucaslimaOP•16mo ago
lucaslima
lucaslimaOP•16mo ago
this is one problem?
npm WARN config product use --moti=dev instead.
npm WARN config product use --moti=dev instead.
Medim
Medim•16mo ago
Not a problem, just a warning cause ur installing devDependencies on a supposed production build but u prob need those devDependencies
lucaslima
lucaslimaOP•16mo ago
yes! thanks man
Medim
Medim•16mo ago
np @lucaslima8925 Right click this message i'm mentioning -> Apps -> Mark Solution So others can see it
lucaslima
lucaslimaOP•16mo ago
😄
Want results from more Discord servers?
Add your server