Questions tagged [pnpm-workspace]
63 questions
17
votes
2 answers
How to add dependency to PNPM workspace?
I start using PNPM Workspaces, and I'm struggling in how to add dependencies to any specific workspace as I would do in yarn running:
yarn workspace add
Or even running scripts for specific packages as I would do…

Arnautg
- 661
- 6
- 10
6
votes
3 answers
Error: `The request url * is outside of Vite serving allow list` after git init of submodule inside pnpm monorepo workspace
I have setup a pnpm workspace with a number of projects that I am adding as git submodules.
A previously working Nuxt project suddenly started giving the error The request url * is outside of Vite serving allow list for multiple files, including…

a2k42
- 672
- 6
- 19
5
votes
0 answers
how to run watch script in pnpm workspace
If I have structure like this
packages
- alice
- bar
- foo
package.json
alice, bar, foo are three sub packages. bar is the dependency of alice.
Every sub package has its own watch script defined in package.json. Now, I add a script likepnpm…

Lynch
- 61
- 3
5
votes
1 answer
Publish NPM package that uses a workspaces as dependencies
so I have a project that I'm working on that is a Monorepo. So I have a packages directory in the root directory that contains all my npm packages. Some of these packages rely on eachother e.g. in a package.json I might have
{
"dependencies": {
…

Artrix
- 149
- 10
5
votes
3 answers
pnpm provides different hashes for the exact same version of the same dependency, breaking nestjs
I have a monorepo with a very basic setup available for reproducing this issue here:
It is a single nestjs app with 2 packages that it reads from.
@nestjs/core among other dependencies is needed for both the packages and the main app to work, and it…

SebastianG
- 8,563
- 8
- 47
- 111
5
votes
1 answer
How to control pnpm workspace build order
I'm working in a large pnpm monorepo (pnpm v7).
The repository contains :
multiple apps
multiple shared dependencies
tooling (shared compilation setup package)
Every package (app or shared library) may reference any shared library (no circular ref…

Steve B
- 36,818
- 21
- 101
- 174
4
votes
2 answers
Mismatching React types in pnpm monorepo
i'm trying to convert an inherited monorepo from yarn+lerna to pnpm workspaces
i'm currently getting an error due to mismatching react versions, typescript isn't picking up on the @types/react version that's closest in the tree for some reason
i…

Tom Sherman
- 83
- 6
4
votes
1 answer
Turborepo -- how to nest applications in the 'apps' folder or different top-level directory?
I'm trying to create a turborepo that contains several types of infrastructure like terraform, potentially 100+ 'serverless' functions.
Ideally, I'd like to organize them a bit more into a subfolder structure that makes sense, rather than have a…

SebastianG
- 8,563
- 8
- 47
- 111
4
votes
1 answer
pnpm in monorepo - how to run a command only in a specific package?
Let's say I want to install a package in a specific package in my monorepo, how do I do this from root?
in npm, you can do this with something like this:
npm install react --workspace=a
I searched the docs and I can't find a way to do this in pnpm.

Jonathan Lightbringer
- 435
- 2
- 12
- 27
4
votes
1 answer
pnpm run on multiples projects based on location
I work within a pnpm workspace that contains some shared libraries, some front apps and some back apps. Schematically:
├── apps-front
│ ├── f1
│ └── f2
├── apps-back
│ ├── b1
│ └── b2
├── packages
│ ├── shared-common
│ └──…

Steve B
- 36,818
- 21
- 101
- 174
3
votes
1 answer
How to setup a bazel workspace with `rules_js` for a monorepo with multiple packages?
I want to setup the bazel build system to build a monorepo with multiple JavaScript packages with the new rules_js rule set. The documentation of rules_js says that it supports "nested npm packages in a monorepo" via "workspaces", but I don't…

Toxaris
- 7,156
- 1
- 21
- 37
3
votes
1 answer
Why does pnpm seem to detect an extra workspace?
I have set up a new project with pnpm and I'm unsure about some of the output I'm seeing when I run recursive commands. Specifically, it seems like pnpm is detecting 3 workspaces when I expect there should only be 2.
The project structure looks like…

Jackson H
- 65
- 3
- 6
3
votes
1 answer
pnpm equivalent to --since option of lerna
I'm migrating to pnpm to manage a monorepo from lerna. However, in the CI, there was a legacy command using the --since option of lerna.
lerna run lint --since origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME...
From what I understand, it allows you to…

Tera Mind
- 263
- 4
- 17
3
votes
1 answer
How to trigger packages to build automatically when using pnpm install?
Our project use pnpm + workspace + typescript follow the monorepo standard. After clone the repository, we run pnpm install to install dependencies and link local packages to each other. But the code inside each package are still remain source code…

user2793120
- 383
- 1
- 4
- 8
3
votes
1 answer
pnpm workspaces does not allow installing of dependencies on brand new projects `cannot read properites of undefined (reading 'manifest')`
I'm trying to use pnpm with lerna to create a monorepo. Unfortunately it all fails when attempting to install lerna itself via pnpm.
Current project structure:
lerna.json contents:
{
"packages": ["functions/*", "libs/*"],
"version": "0.0.0",
…

SebastianG
- 8,563
- 8
- 47
- 111