This guide documents the migration from Yarn to npm workspaces for the Argos Platform monorepo. It explains what changed, why, and how to work with the new setup.
- Overview
- What Changed
- Command Reference
- CI/CD Pipeline Changes
- Developer Workflow Changes
- Troubleshooting
- FAQ
The Argos Platform monorepo has been migrated from Yarn to npm workspaces to:
- Simplify tooling (use npm's built-in workspace support)
- Improve dependency management with better hoisting
- Reduce lock file conflicts
- Align with modern npm best practices
- Improve CI/CD build performance
Migration Date: January 2026
npm Version Required: 7.0.0 or higher (for workspace support)
Node.js Version Required: 16.0.0 or higher
Before (Yarn):
# Install dependencies
yarn
# Install in specific directory
cd argos-sdk && yarn
cd products/argos-saleslogix && yarn
# Run scripts
yarn run build
yarn run testAfter (npm workspaces):
# Install all dependencies from root
npm install
# Run scripts in specific workspace
npm run build -w argos-sdk
npm run test -w products/argos-saleslogix
# Or use convenience scripts
npm run build:all
npm run test:sdkRemoved:
yarn.lock(all instances).yarnrcfiles (if any existed)
Added:
package-lock.json(at root only)- Root
package.jsonwith workspace configuration
Modified:
argos-sdk/package.json- removed shared dependenciesproducts/argos-saleslogix/package.json- added workspace dependency on argos-sdkJenkinsfile- updated to use npm commands
Shared dependencies (used by multiple packages) are now in the root package.json:
- grunt and grunt plugins
- babel packages
- eslint packages
- jasmine
Package-specific dependencies remain in their respective package.json files:
- argos-saleslogix: express, mocha, playwright
- Any dependencies unique to one package
argos-saleslogix now references argos-sdk using the workspace protocol:
{
"dependencies": {
"argos-sdk": "workspace:*"
}
}This creates a symlink, enabling live updates during development.
| Yarn | npm Workspaces |
|---|---|
yarn |
npm install |
cd argos-sdk && yarn |
npm install (from root) |
yarn install --frozen-lockfile |
npm ci |
| Yarn | npm Workspaces |
|---|---|
yarn run build |
npm run build (in package dir) |
yarn run test |
npm run test (in package dir) |
| N/A | npm run build -w argos-sdk (from root) |
| N/A | npm run build --workspaces (all packages) |
| Yarn | npm Workspaces |
|---|---|
yarn add <pkg> |
npm install <pkg> (in package dir) |
yarn add -D <pkg> |
npm install -D <pkg> (in package dir) |
| N/A | npm install <pkg> -w argos-sdk (from root) |
| Yarn | npm Workspaces |
|---|---|
yarn remove <pkg> |
npm uninstall <pkg> (in package dir) |
| N/A | npm uninstall <pkg> -w argos-sdk (from root) |
New commands available with npm workspaces:
# Run command in specific workspace from root
npm run build -w argos-sdk
npm run test -w products/argos-saleslogix
# Run command in all workspaces
npm run build --workspaces
npm run test --workspaces
# List all workspaces
npm ls --workspaces
# Install dependencies for specific workspace
npm install <package> -w argos-sdkBefore (Yarn):
stage('Build SDK') {
dir('argos-sdk') {
sh 'yarn'
sh 'yarn run build'
sh 'yarn run test'
}
}
stage('Build SalesLogix') {
dir('products/argos-saleslogix') {
sh 'yarn'
sh 'yarn run build'
sh 'yarn run test'
}
}After (npm workspaces):
stage('Install Dependencies') {
sh 'npm install'
}
stage('Build SDK') {
sh 'npm run build -w argos-sdk'
sh 'npm run test -w argos-sdk'
}
stage('Build SalesLogix') {
sh 'npm run build -w products/argos-saleslogix'
sh 'npm run test -w products/argos-saleslogix'
}- Single installation:
npm installruns once at the root instead of in each directory - Faster builds: Shared dependencies are hoisted, reducing installation time
- Explicit targeting:
-wflag clearly indicates which workspace is being built - Parallel execution: Can run
npm run build --workspacesto build all packages
Ensure your CI/CD environment has:
- Node.js 16+ installed
- npm 7+ installed (comes with Node.js 16+)
- Sufficient permissions to create symlinks (for workspace dependencies)
Before:
# Start working
cd argos-sdk
yarn
yarn run build
cd ../products/argos-saleslogix
yarn
yarn run buildAfter:
# Start working (from root)
npm install
npm run build:all
# Or build individually
npm run build:sdk
npm run build:saleslogixBefore:
cd argos-sdk
# Make changes
yarn run build
cd ../products/argos-saleslogix
yarn run build # Uses published or linked versionAfter:
cd argos-sdk
# Make changes
npm run build
cd ../products/argos-saleslogix
npm run build # Automatically uses local version via symlinkKey benefit: No need to manually link packages. The workspace symlink ensures argos-saleslogix always uses the local argos-sdk.
Shared dependency (used by multiple packages):
# Add to root package.json devDependencies
npm install -D <package-name> -w root
# Or manually edit root package.json and run:
npm installPackage-specific dependency:
# From root
npm install <package-name> -w argos-sdk
# Or from package directory
cd argos-sdk
npm install <package-name>Before:
cd argos-sdk
yarn run test
cd ../products/argos-saleslogix
yarn run testAfter:
# From root
npm run test:all
# Or individually
npm run test:sdk
npm run test:saleslogix
# Or from package directory
cd argos-sdk
npm run testSymptoms: argos-saleslogix cannot find argos-sdk during build or runtime.
Cause: Workspace symlink not created properly.
Solution:
# Delete node_modules and lock file
rm -rf node_modules package-lock.json
rm -rf argos-sdk/node_modules
rm -rf products/argos-saleslogix/node_modules
# Reinstall
npm install
# Verify symlink exists
ls -la products/argos-saleslogix/node_modules/argos-sdkSymptoms: npm install fails with workspace protocol error.
Cause: npm version is too old (< 7.0.0).
Solution:
# Check npm version
npm --version
# Update npm if needed
npm install -g npm@latest
# Or update Node.js to 16+ which includes npm 7+Symptoms: Different packages require incompatible versions of the same dependency.
Cause: Attempting to hoist dependencies with conflicting version requirements.
Solution:
# Keep conflicting dependencies local to each package
# In argos-sdk/package.json:
{
"devDependencies": {
"some-package": "^1.0.0"
}
}
# In products/argos-saleslogix/package.json:
{
"devDependencies": {
"some-package": "^2.0.0"
}
}
# npm will install both versions locally
npm installSymptoms: Grunt cannot find argos-sdk or tasks fail with "path not found" errors.
Cause: Gruntfile still uses old hardcoded path instead of workspace resolution.
Solution:
Verify products/argos-saleslogix/Gruntfile.js uses:
const path = require('path');
const sdkPath = path.dirname(require.resolve('argos-sdk/package.json'));Instead of:
basePath: '../../argos-sdk' // Old approachSymptoms: Jenkins build fails with npm errors.
Cause: Jenkinsfile not updated or environment doesn't support npm workspaces.
Solution:
- Verify Jenkinsfile uses
npm installnotyarn - Verify Jenkinsfile uses
npm runnotyarn run - Check Node.js version in CI environment:
node --version(should be 16+) - Check npm version in CI environment:
npm --version(should be 7+)
Symptoms: Build fails with file not found errors.
Cause: Dependencies not installed or workspace structure corrupted.
Solution:
# Clean install
rm -rf node_modules package-lock.json
rm -rf argos-sdk/node_modules
rm -rf products/argos-saleslogix/node_modules
npm install
# Verify workspace structure
npm ls --workspacesSymptoms: After modifying argos-sdk, argos-saleslogix still uses old code.
Cause: argos-sdk not rebuilt or symlink broken.
Solution:
# Rebuild argos-sdk
npm run build -w argos-sdk
# Verify symlink
ls -la products/argos-saleslogix/node_modules/argos-sdk
# If symlink is broken, reinstall
npm installIf you encounter issues not covered here:
- Check the npm workspaces documentation
- Verify your npm version:
npm --version(should be 7+) - Check for error messages in the console output
- Review the README.md for correct command syntax
- Contact the development team for assistance
- Simplification: npm workspaces is built into npm, reducing external dependencies
- Performance: Better dependency hoisting and faster installs
- Compatibility: Better alignment with modern Node.js ecosystem
- Maintenance: One less tool to maintain and update
Yes, but minimally:
- Ensure you have Node.js 16+ (which includes npm 7+)
- Use
npm installinstead ofyarn - Use
npm runinstead ofyarn run - All script names remain the same
No. The build artifacts are identical. Only the build process changed, not the output.
Yes! You can still cd into a package and run npm run build, npm run test, etc. The workspace structure doesn't prevent this.
When you publish packages, npm automatically converts workspace:* to the actual version number. During development, it uses the local symlink.
Root devDependencies: Tools used by multiple packages (grunt, babel, eslint, jasmine)
Package dependencies: Libraries specific to one package (express, mocha, playwright)
When in doubt, if only one package uses it, keep it local.
Keep them local to each package. npm will install both versions in their respective node_modules directories instead of hoisting.
# Update all dependencies
npm update
# Update specific dependency in a workspace
npm update <package-name> -w argos-sdk
# Update dependency in all workspaces
npm update <package-name> --workspacesThe old yarn.lock files have been removed. If you need to reference old dependency versions, check git history:
git show HEAD~1:yarn.lockRun the verification checklist:
# Verify installation
npm install
# Verify builds
npm run build:all
# Verify tests
npm run test:all
# Verify workspace structure
npm ls --workspaces
# Verify symlink
ls -la products/argos-saleslogix/node_modules/argos-sdkAll commands should complete successfully.
Last Updated: January 2026
Migration Version: 1.0.0