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