Open robdonn opened 7 years ago
This also breaks other tools like React Native. I'm guessing that hoisting the dependencies to the root seems to break the scripts being called to run them.
Error: React native is not installed. Please run `npm install` in your project directory.
Also breaks Meteor - it does not look at packages in parent node_modules. When I asked them to support that, they answered:
Meteor does not, and will not ever, consider node_modules directories outside your application root directory, because that would require you to somehow recreate that surrounding environment on the server where you deploy your app. The app should be self-contained. (benjamn, core member)
If there was a way to indicate that a certain directory should have all it's package.json packages available in it's local node_modules, for example through a flag in package.json (even if these were just symlinks to the parent node_modules), this would work.
Currently it works if we symlink all packages from the root node_modules to our Meteor app node_modules, however if I try to install a new package from within the Meteor folder, yarn deletes all packages in the Meteor node_modules folder, breaking it again.
support for nohoist
has been added by #4979 and is available in Yarn v1.5.0+.
check nohoist in Workspaces. @robdonn please consider closing this issue.
I've defined my mono-repo root's package.json as below and it seems to work...
{
"private": true,
"workspaces": {
"packages": [
"shared-logic",
"electron-app",
"react-native-app"
],
"nohoist": [
"**/react-native", "**/react-native/**",
"**/electron", "**/electron/**",
"**/jest", "**/jest/**"
]
}
}
so far no compilation errors and apps run both on the electron and react native side.
Do you want to request a feature or report a bug? Bug
What is the current behavior? When working in a monorepo using Yarn workspaces and the dependencies for an electron app are hoisted to root, when you run
lerna bootstrap
the electron app is no longer operable from the scripts in package.json"start": "electron ."
Error
Directory
lerna.json
root package.json
Desktop/Electron app package.json
If the current behavior is a bug, please provide the steps to reproduce. Sample repo & instructions
What is the expected behavior? Running
yarn start
should trigger electron app to launch.Please mention your node.js, yarn and operating system version. Node.js -v : 8.2.1 yarn -v : 0.27.5_1 OS -v : macOS Sierra v10.12.6