Hi, there are not setup or anything like that in v3. A plugin is an npm package so all its dependencies are automatically installed when doing npm install plugin-name
I still don’t understand what you mean about installing dependencies with strapi-cli ? why not make your app a monorepo so you can install dependencies in the plugins folder too ?
There is a feature called “Workspaces”, which helps you to setup multiple packages in such a way that you only need to run yarn install once to install all of them in a single pass.
To achieve this start using yarn instead of npm. As npm released workspaces just a few weeks ago for v7 (which is available with Node v15).
Add workspaces to the package.json, In your case your local plugins that are under development. Please note that "private": true property is mandatory when working with workspaces.
Now run yarn install, it will install all your packages from ./plugins/{plugin-name}/package.json. Also it will create a symlink for your plugin inside the node_modules:
Please note that after this Yarn will not allow you to add packages into the root packages.json, as it is expecting you to add them to Workspaces. To add a package to root packages.json please add the -W flag:
SOLUTION: Ok I solved it by adding plugin dependencies to the main package.json. I did not remove the old dependencies from the /src/plugins/myplugin/package.json, but I think you can. I do not use yarn workspaces. Adding the dependency was all I did and the plugin works without going into plugin directory and running npm install separately.
thank you for sharing this solution with community.
my solution was insalling dependencies by manually.
here is my dockerfile;
FROM node:20
# alternatively you can use FROM strapi/base:latest
# Set up working directory
WORKDIR /app
# Copy package.json to root directory
COPY package.json .
# Copy yarn.lock to root directory
COPY yarn.lock .
# Install dependencies, but not generate a yarn.lock file and fail if an update is needed
RUN yarn install --frozen-lockfile
# Copy strapi project files
COPY . .
# TODO: You should add new plugins here
RUN cd src/plugins/test-plugin && yarn install --frozen-lockfile
# Build admin panel
RUN yarn build
# Run on port 1337
EXPOSE 1337
# Start strapi server
CMD ["yarn", "start"]