{"record":{"id":"4f6d9c27ada56451","repo":"yarnpkg/yarn","slug":"your-project-root-defines-workspaces-but-the-featu","errorCode":null,"errorMessage":"Your project root defines workspaces but the feature is disabled in your Yarn config. Please check \"workspaces-experimental\" in your .yarnrc file.","messagePattern":"Your project root defines workspaces but the feature is disabled in your Yarn config\\. Please check \"workspaces-experimental\" in your \\.yarnrc file\\.","errorType":"validation","errorClass":"MessageError","httpStatus":null,"severity":"error","filePath":"src/config.js","lineNumber":447,"sourceCode":"\n    //init & create cacheFolder, tempFolder\n    this.cacheFolder = path.join(this._cacheRootFolder, 'v' + String(constants.CACHE_VERSION));\n    this.tempFolder = opts.tempFolder || path.join(this.cacheFolder, '.tmp');\n    await fs.mkdirp(this.cacheFolder);\n    await fs.mkdirp(this.tempFolder);\n\n    if (opts.production !== undefined) {\n      this.production = Boolean(opts.production);\n    } else {\n      this.production =\n        Boolean(this.getOption('production')) ||\n        (process.env.NODE_ENV === 'production' &&\n          process.env.NPM_CONFIG_PRODUCTION !== 'false' &&\n          process.env.YARN_PRODUCTION !== 'false');\n    }\n\n    if (this.workspaceRootFolder && !this.workspacesEnabled) {\n      throw new MessageError(this.reporter.lang('workspacesDisabled'));\n    }\n  }\n\n  _init(opts: ConfigOptions) {\n    this.registryFolders = [];\n    this.linkedModules = [];\n\n    this.registries = map();\n    this.cache = map();\n\n    // Ensure the cwd is always an absolute path.\n    this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd());\n\n    this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver;\n\n    this.commandName = opts.commandName || '';\n\n    this.enableDefaultRc = opts.enableDefaultRc !== false;","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/config.js#L429-L465","documentation":"Thrown at the end of `config.init` when `workspaceRootFolder` was found (an ancestor package.json declares `workspaces`) but `workspacesEnabled` is false. Workspaces are gated by the `workspaces-experimental` option; if it is explicitly set to `false` in .yarnrc the feature is disabled, and a project that declares workspaces becomes a contradiction Yarn refuses to proceed with.","triggerScenarios":"An ancestor .yarnrc or user-level ~/.yarnrc contains `workspaces-experimental false`, while a package.json in the project chain declares a `workspaces` field.","commonSituations":"An old .yarnrc from when workspaces were unstable disabled the feature, and the project later adopted workspaces. A global ~/.yarnrc sets it off for all projects. Corporate shared config disables experimental features.","solutions":["Remove `workspaces-experimental false` from your .yarnrc (~/.yarnrc or project-level .yarnrc).","Set `workspaces-experimental true` explicitly, or simply omit the key (default is enabled).","Search all .yarnrc files in the chain: `yarn config ls` to see effective values."],"exampleFix":"# before (.yarnrc)\nworkspaces-experimental false\n# after\n# (delete the line, or set to true)\nworkspaces-experimental true","handlingStrategy":"validation","validationCode":"// Before init, check that workspaces are not disabled when a root declares workspaces.\nconst workspacesEnabled = config.getOption('workspaces-experimental') !== false;\nif (rootManifest && rootManifest.workspaces && !workspacesEnabled) {\n  console.error('Enable workspaces: remove \"workspaces-experimental false\" from .yarnrc');;\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await config.init(opts);\n} catch (err) {\n  if (err.message.includes('workspaces-experimental')) {\n    reporter.error('Set workspaces-experimental true in .yarnrc or remove the setting.');\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Audit .yarnrc files (project, user, global) for `workspaces-experimental false`.","Use `yarn config ls` to see the effective config in monorepo projects.","Do not carry stale .yarnrc settings across project migrations."],"tags":["workspaces","config","yarnrc"],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}