Resolve Monorepo Issues
This page covers common issues and solutions when working with monorepo in Vega Studio. If you don't find a solution to your specific problem here, post an issue in Developer Forum for additional support.
Unsupported package manager
Cause: Vega Studio displays an error or fails to build when trying to use package managers other than npm or yarn v2. Vega Studio only supports npm
and yarn v2
CLI. Other package managers won't work correctly with the build system.
Solution: Switch to a supported package manager:
- Use npm for standard package management
- Use yarn v2+ for advanced workspace features
Package manager not detected
Cause: Vega Studio can't detect the package manager in your monorepo and defaults to npm incorrectly. For empty or clean monorepos, detection can be challenging. Vega Studio defaults to npm
, which might not apply to your setup.
Solution: Help Vega Studio identify your package manager:
- Install dependencies manually (
npm install
for npm andyarn install
for yarn). - Place an appropriate (even empty) lock file (package-lock.json or yarn.lock) in the monorepo root directory.
Build fails with "Turbo module tgz dependency not found or malformed" error
Cause: The build system can't locate or process the .tgz file referenced in your package.json dependencies.
Solution: Replace the file pointer to tgz
with the latest package version:
// REPLACE
"@prefix/module-name": "file:...../prefix-module-name-0.0.1.tgz"
// WITH
"@prefix/module-name": "*"
npm installation fails during monorepo setup
Cause: Missing npm installation, incorrect .npmrc configuration, or conflicting files in parent directories.
Solution:
-
Verify that
npm
is installed:npm -v
-
Verify
.npmrc
is present and correct. -
Remove conflicting files or directories in parent folders or your HOME folder:
- package.json files
- node_modules directories
- npm artifacts
Yarn installation fails during monorepo setup
Cause: Incorrect yarn version, missing yarn installation, or conflicting configuration files.
Solution:
-
Verify that you have yarn v2+:
yarn --version
-
Uninstall yarn 1 (if present):
-
Install Yarn using corepack (node versions 14+):
corepack enable
-
In package.json, specify the correct package manager:
"packageManager": "yarn@x.y.z"
-
Prepare yarn:
corepack prepare yarn@x.y.z --activate
- Create an empty
yarn.lock
file in the monorepo root. - Remove conflicting files or directories in parent folders or your HOME folder:
- package.json, package-lock.json, and yarn.lock
- node_modules directories
- npm artifacts
Build fails when installing Yarn dependencies
Cause: Incorrect yarn repository configuration or missing authentication tokens in .yarnrc.yml file.
Solution:
-
Configure yarn repositories correctly (.yarnrc.yml file).
For instructions, see Configure yarn workspaces.
-
Add the following configuration to
.yarnrc.yml
as needed:npmRegistries: "https://k-artifactory-external.labcollab.net/artifactory/api/npm/kepler-npm-prod-local/": npmAuthToken: "<KEPLER-TOKEN>"
Build fails in the packaging step when using Metro packager.
Cause: Metro packager can't resolve dependencies in the monorepo structure due to incorrect path configuration.
Solution: Configure dependencies in metro.config.js:
const path = require('path');
const config = {
projectRoot: __dirname,
watchFolders: [
path.resolve(__dirname, '../../packages'),
path.resolve(__dirname, '../../node_modules')
],
resolver: {
disableHierarchicalLookup: true,
nodeModulesPaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, '../../node_modules')
]
}
};
Related topics
Last updated: Sep 30, 2025