I'm having trouble running my app with NPM 7 Workspaces. I am expecting an npm install
from the root folder to create a node_modules
folder for each of my workspaces, similar to Lerna. However, when I run npm install
at the root, I only get one node_modules
, at the root level. Is this expected?
Example structure before npm i
:
.
├── package.json -> { "workspaces": ["packages/*"] }
└── packages
├── a
│ ├── index.js
│ └── package.json
├── b
│ ├── index.js
│ └── package.json
└── c
├── index.js
└── package.json
Example structure after npm i
(note only one package-lock.json
/node_modules
):
.
├── package.json -> { "workspaces": ["packages/*"] }
├── **node_modules**
├── **package-lock.json**
└── packages
├── a
│ ├── index.js
│ └── package.json
├── b
│ ├── index.js
│ └── package.json
└── c
├── index.js
└── package.json
Node version: 16.4.2
NPM version: 7.18.1