New answer:
As of v7.13, you can set node-linker=hoisted in a .npmrc
in the root of your project. pnpm will create a flat node_modules like the one created by npm or Yarn, without using symlinks at all.
Old answer:
As of version 5.14, the only way to avoid symlinks with pnpm is to use the Plug'n'Play feature and set the symlink setting to false. You can create a .npmrc
in the root of you project with the following content:
node-linker=pnp
symlink=false
Using the hoist settings you can only reduce the number of symlinks, not avoid them. This blog post should explain the different configurations: Node-Modules configuration options with pnpm. With hoist=false
, you'll get the minimal amount of symlinks.
Plug'n'Play is known to still have lots of issues, so if it doesn't help, feel free to ask for help in the pnpm discord channel or create an issue in our repository.