Error: Cannot find module '/app/dist/index.js'
sibabale
TRIALOP

2 years ago

I am deploying an Apollo Graphq server from within a monorepo and I am getting the above error. I do have a dist/index.js but I don't have the app/ directory.

View Deploy details

ⓘ Deployment information is only viewable by Project members and Railway admins.

Closed

8 Replies

2 years ago

You created ~15 duplicate threads, why?


sibabale
TRIALOP

2 years ago

Where are these other threads, I am new to your platform.


2 years ago

They have since been removed, going forward, please don't open duplicate threads.


2 years ago

Please attach your package.json


sibabale
TRIALOP

2 years ago

{

"name": "fixa",

"version": "1.0.0",

"description": "",

"main": "index.js",

"scripts": {

"compile": "tsc",

"start": "nodemon --watch './**/*.ts' --exec 'ts-node src/index.ts'"

},

"keywords": [],

"author": "Sibabale Joja ",

"license": "MIT",

"dependencies": {

"@apollo/server": "4.10.2",

"@graphql-tools/load-files": "7.0.0",

"@graphql-tools/schema": "10.0.3",

"@types/faker": "6.6.9",

"apollo-server-core": "3.13.0",

"axios": "1.6.8",

"dotenv": "16.4.5",

"graphql": "16.8.1",

"graphql-tag": "2.12.6",

"mysql2": "3.9.3",

"typeorm": "0.3.20"

},

"devDependencies": {

"@faker-js/faker": "8.4.1",

"@types/node": "20.11.30",

"nodemon": "3.1.0",

"ts-node": "10.9.2",

"typescript": "5.4.3"

},

"engines": {

"node": "18.x"

}

}


sibabale
TRIALOP

2 years ago

Here is my package.json


2 years ago

Try renaming the compile script to build, renaming your start script to dev, and then adding a new start script that would be something along the lines of node dist/index.js


loverphp487
FREE

a year ago

in build command in setttings use tsc -d instead of npm run build


Status changed to Closed brody about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...