This plugin looks for to the node_modules to know where to find the packages to link but that's a different approach than yarn workspaces takes. yarn workspaces uses the workspaces array in the package.json to know where to look for the packages to link. That allows it to know where the packages can be found even if node_modules doesn't have any of the packages. It seems like that would be a good approach for the serverless-plugin-monorepo as well.
What is happening for me is that I am running yarn install at the root of the project and some of my packages are hoisted and symlinked at that time and are in the top level node_modules folder. Then when running serverless deploy the symlinks are cleaned and removed and when the plugin tries to recreate the links it looks to the node_modules for the packages but there's nothing there because it just cleaned up the links. My workaround was to comment out the clean functions references from the plugin and run yarn install before running serverless deploy.
This plugin looks for to the node_modules to know where to find the packages to link but that's a different approach than
yarn workspacestakes.yarn workspacesuses the workspaces array in the package.json to know where to look for the packages to link. That allows it to know where the packages can be found even if node_modules doesn't have any of the packages. It seems like that would be a good approach for the serverless-plugin-monorepo as well.What is happening for me is that I am running
yarn installat the root of the project and some of my packages are hoisted and symlinked at that time and are in the top level node_modules folder. Then when runningserverless deploythe symlinks are cleaned and removed and when the plugin tries to recreate the links it looks to the node_modules for the packages but there's nothing there because it just cleaned up the links. My workaround was to comment out the clean functions references from the plugin and runyarn installbefore runningserverless deploy.