notiz-dev / nestjs-prisma-starter

Starter template for NestJS 😻 includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker
MIT License
2.37k stars 336 forks source link

Docker compose up error "Could not find package.json" #468

Closed nombrekeff closed 2 years ago

nombrekeff commented 2 years ago

Hey there!

I've been trying to run the project with docker by running: npm run docker or docker-compose -f docker-compose.yml up --build

And it gives me an error which I can't find a solution to. The error is:

> nestjs-prisma-client-starter@0.0.1 start:prod
nest-api    | > node dist/main
nest-api    | 
nest-api    | /node_modules/flaschenpost/dist/readPackageJson.js:16
nest-api    |     throw new Error('Could not find package.json.');
nest-api    |     ^
nest-api    | 
nest-api    | Error: Could not find package.json.
nest-api    |     at readPackageJson (/node_modules/flaschenpost/dist/readPackageJson.js:16:11)
nest-api    |     at Object.flaschenpost.initialize (/node_modules/flaschenpost/dist/flaschenpost.js:23:36)
nest-api    |     at Object.<anonymous> (/node_modules/flaschenpost/dist/flaschenpost.js:111:14)
nest-api    |     at Module._compile (node:internal/modules/cjs/loader:1126:14)
nest-api    |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
nest-api    |     at Module.load (node:internal/modules/cjs/loader:1004:32)
nest-api    |     at Function.Module._load (node:internal/modules/cjs/loader:839:12)
nest-api    |     at Module.require (node:internal/modules/cjs/loader:1028:19)
nest-api    |     at require (node:internal/modules/cjs/helpers:102:18)
nest-api    |     at Object.<anonymous> (/node_modules/node-poeditor/lib/workers/request/httprequest.js:4:16)
nest-api exited with code 1

Any idea what I could do to fix this? It seems that the package.json is in copied in the Dockerfile, but when running npm run start:prod it does not find it.

nombrekeff commented 2 years ago

Okay, I've realized it has nothing to do with the started project. It's something to do with one of the dependencies I'm using...

marcjulian commented 2 years ago

Okay i will close the issue for now. If you run into any other problems let me know