Já olhei várias correções na comunidade mas ainda não conseguir resolver o problema. Estou usando yarn.
Jan 10 09:32:52 AM ==> Starting service with 'node index.js'
Jan 10 09:32:52 AM internal/modules/cjs/loader.js:888
Jan 10 09:32:52 AM throw err;
Jan 10 09:32:52 AM ^
Jan 10 09:32:52 AM
Jan 10 09:32:52 AM Error: Cannot find module '/opt/render/project/src/index.js'
Jan 10 09:32:52 AM at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
Jan 10 09:32:52 AM at Function.Module._load (internal/modules/cjs/loader.js:730:27)
Jan 10 09:32:52 AM at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Jan 10 09:32:52 AM at internal/main/run_main_module.js:17:47 {
Jan 10 09:32:52 AM code: 'MODULE_NOT_FOUND',
Jan 10 09:32:52 AM requireStack: []
meu package. json
{
"name": "api-student-default",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2"
},
"scripts": {
"dev": "tsnd --transpile-only --respawn --ignore-watch node_modules src/server.ts",
"build": "yarn && tsc",
"start": "node ./dist/index.js"
},
"devDependencies": {
"@types/cors": "^2.8.13",
"@types/express": "^4.17.15",
"ts-node-dev": "^2.0.0",
"typescript": "^4.9.4"
}
}
jsonconfig
{
"compilerOptions": {
"target": "ES2021",
"lib": [
"esnext"
],
"module": "commonjs",
"rootDir": "src",
"baseUrl": "./",
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
Dese já agradeço a atenção.