Deploy a monorepo without absolut node_module links #7341
-
I am desperately trying to build a monorepo project with pnpm and then copy it to another server. I use the commands "pnpm i" followed by "pnpm build" and "pnpm --filter=<deployed project name> --prod deploy <target directory>". Unfortunately, node modules references are always linked in a bash file, which gets an absolute path to the dependencies. As a result, the project cannot be executed after copying the contents in the <target_directory> to the actual server, because node cannot resolve the dependencies. Project structure:
All I need at the end is a folder in which the created "api" or "frontend" project is located with all node module dependencies without wild references from my system on which it is created. So that I can simply move the build to another server and run it with node. I can't find a way to build the project correctly, HELP. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Found an open issue describing our problem #6166 |
Beta Was this translation helpful? Give feedback.
-
@dotMortis Here is example and described proccess: |
Beta Was this translation helpful? Give feedback.
@dotMortis
Are you on Windows/Linux?
Have you tried zipping the folder with the --symlinks flag?
I had the same problem but solved it and I was able to copy it to the destination and properly resolve the dependencies even on AWS Lambda (and to classic VPS too)
Here is example and described proccess:
https://github.com/UROjQ6r80p/pnpm-aws-monorepo