Issue in migrating Strapi from Server A to B

I encountered the same issue when I used scp -r to transfer the Strapi project from one server to another. On the original server, node_modules/.bin/strapi was a soft link, but after copying it to the destination server, it became a regular file. This caused an error when trying to run the project: “Error: Cannot find module ‘…/dist/cli’”. To avoid this issue when migrating a Strapi project, you should first use the tar command to create an archive, and then copy it to the target server. This should resolve the problem.

1 Like