I am searching for a way to have one node_modules folder to use in my different projects. I found pnpm
, installed it, and created one project with the commands:
ng new test-pnpm --skip-install
ng config cli.packageManager pnpm
pnpm install
ng serve
This project doesn't start. When I delete this project and .pnpm-stor folder
, I cannot install packages for the next project with pnpm
.
Can anyone tell me the steps to use it in a project, how to configure, how to install, how to add packages, and how to use it in different projects?
“In pnpm, packages are always reused if they are already installed for another project saving a lot of disk space which makes it faster and more efficient than npm.”
pnpm install is used to install all dependencies for a project. In a CI environment, installation fails if a lockfile is present but needs an update. Inside a workspace, pnpm install installs all dependencies in all the projects. If you want to disable this behavior, set the recursive-install setting to false .
js version manager. See pnpm env use. Works everywhere. Supports Windows, Linux, and macOS.
Don't remove the .pnpm-store
folder. Only remove node_modules
if you want to.
Try to run pnpm install --shamefully-hoist
. If it helps, you can create a .npmrc
file in the root of your project with shamefully-hoist=true
.
The issue is that pnpm creates a strict node_modules
and sometimes packages require other packages that are not declared in their package.json
. See pnpm’s strictness helps to avoid silly bugs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With