Local workspaces not being symlinked to node modules (when circular deps exist)
#5,538 创建于 2018年3月18日
描述
Do you want to request a feature or report a bug?
Bug report. I have this project called Beemo, which is a monorepo with workspaces/packages like @beemo/cli, @beemo/core, and @beemo/driver-*. Beemo is a configuration management layer, and as such, I have another NPM module called @milesj/build-tool-config, which depends on the same released version (0.13). Basically Beemo is using Beemo to configure itself, and technically I have a reference chain like so:
/packages
/core (@beemo/core)
/cli (@beemo/cli)
/driver-* (@beemo/driver-*)
/node_modules
/@milesj/build-tool-config
/node_modules
/@beemo/core (0.13)
/@beemo/cli (0.13)
/@beemo/driver-* (0.13)
When I yarn install, the dependent versions are hoisted to the root, like the example below. At this point, local /packages are not symlinked to /node_modules, as I assume Yarn believes that path is already taken. BUT, the @milesj/build-tool-config package doesn't depend on all @beemo packages, yet the packages that aren't depended on DO NOT get symlinked either (for example, @beemo/driver-mocha is not symlinked).
# hoisted
/packages
/core (@beemo/core)
/cli (@beemo/cli)
/driver-* (@beemo/driver-*)
/node_modules
/@beemo/core (0.13)
/@beemo/cli (0.13)
/@beemo/driver-* (0.13)
/@milesj/build-tool-config
If I utilize nohoist to not hoist the @milesj/build-tool-config packages to the root, like the following, local packages STILL DO NOT symlink.
# nohoist
/packages
/core (@beemo/core)
/cli (@beemo/cli)
/driver-* (@beemo/driver-*)
/node_modules
/ NO SYMLINKS
/@milesj/build-tool-config
/node_modules
/@beemo/core (0.13)
/@beemo/cli (0.13)
/@beemo/driver-* (0.13)
Because of this, I'm unable to work on this project, or release new versions.
What is the current behavior?
Local /packages are not symlinked whatsoever, with hoisting, and without hoisting.
What is the expected behavior?
Local /packages should be symlinked to /node_modules. This used to work in Yarn 1.3, but seems to have broken in 1.5. This might be related to the new nohoist feature.
Please mention your node.js, yarn and operating system version.
| Executable | Version |
|---|---|
lerna --version |
3.0.0-beta.3 |
npm --version |
5.6.0 |
yarn --version |
1.5.1 |
node --version |
9.8.0 |
| OS | Version |
|---|---|
| macOS Sierra | 10.13.3 |