This warning appears when you try to use npm workspaces (monorepo feature) with npm version 6 or older. Workspaces were introduced in npm v7.0.0, so you need to upgrade npm to use this feature.
Fixes npm WARN workspaces npm WARN workspaces Workspaces require npm v7 or higher
npm --versionnpm --versionnpm WARN workspaces npm WARN workspaces Workspaces require npm v7 or higher
On this page
npm workspaces is a native monorepo feature that manages multiple packages from a single root directory. This feature was introduced in npm v7.0.0 released in late 2020. When npm detects workspace configuration but runs on npm v6 or earlier, it warns that workspaces are not supported.
Verify which npm version you're running:
npm --versionIf it's below 7.0.0, you need to upgrade.
Upgrade npm globally:
npm install -g npm@latestOr install a specific version:
npm install -g npm@9Verify the upgrade:
npm --versionnpm v7+ is bundled with Node.js v15.0.0+. Upgrade to Node.js 16 LTS or later:
- Download from https://nodejs.org/
- Or use nvm: nvm install --lts && nvm use --lts
- Or use Homebrew: brew install node@18
After upgrading, clear cache and reinstall:
npm cache clean --force
rm -rf node_modules package-lock.json
npm installCheck that your workspaces are properly recognized:
npm ls --workspacesYou should see a tree of your workspace packages without warnings.
npm workspaces support was gradually rolled out: npm v7.0.0 introduced basic workspace support, but npm v7.14.0+ added full support for npm install and npm uninstall within workspaces. If you're on npm v7.0-v7.13, consider upgrading further. For complex monorepos with version conflicts, use the overrides field in the root package.json to enforce consistent dependency versions (npm v8.3.0+).