{"record":{"id":"6ef4c2972e5aec83","repo":"affaan-m/ECC","slug":"warning-pmname-is-not-installed-on-your-system","errorCode":null,"errorMessage":"Warning: ${pmName} is not installed on your system","messagePattern":"Warning: (.+?) is not installed on your system","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"scripts/setup-package-manager.js","lineNumber":124,"sourceCode":"    console.log(`${pmName}${current}`);\n    console.log(`  Installed: ${installed ? 'Yes' : 'No'}`);\n    console.log(`  Lock file: ${config.lockFile}`);\n    console.log(`  Install: ${config.installCmd}`);\n    console.log(`  Run: ${config.runCmd}`);\n    console.log('');\n  }\n}\n\nfunction setGlobal(pmName) {\n  if (!PACKAGE_MANAGERS[pmName]) {\n    console.error(`Error: Unknown package manager \"${pmName}\"`);\n    console.error(`Available: ${Object.keys(PACKAGE_MANAGERS).join(', ')}`);\n    process.exit(1);\n  }\n\n  const available = getAvailablePackageManagers();\n  if (!available.includes(pmName)) {\n    console.warn(`Warning: ${pmName} is not installed on your system`);\n  }\n\n  try {\n    setPreferredPackageManager(pmName);\n    console.log(`\\n✓ Global preference set to: ${pmName}`);\n    console.log('  Saved to: ~/.claude/package-manager.json');\n    console.log('');\n  } catch (err) {\n    console.error(`Error: ${err.message}`);\n    process.exit(1);\n  }\n}\n\nfunction setProject(pmName) {\n  if (!PACKAGE_MANAGERS[pmName]) {\n    console.error(`Error: Unknown package manager \"${pmName}\"`);\n    console.error(`Available: ${Object.keys(PACKAGE_MANAGERS).join(', ')}`);\n    process.exit(1);","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/setup-package-manager.js#L106-L142","documentation":"setup-package-manager.js `setGlobal` confirms the requested package manager exists in the known PACKAGE_MANAGERS map, then checks whether its binary is actually available on the system (getAvailablePackageManagers). If not installed, it warns but proceeds — the preference is still saved for a future environment where the tool exists.","triggerScenarios":"Running the setter (e.g. `node scripts/setup-package-manager.js --set-global pnpm` or equivalent flag) with a valid pmName whose executable is not found on PATH via getAvailablePackageManagers().","commonSituations":"Configuring a new machine before installing pnpm/yarn/bun; switching preferred PM on CI where only npm is preinstalled; setting a preference for a PM planned to be installed later.","solutions":["Install the missing package manager (e.g. `npm i -g pnpm`, `corepack enable`, or the official installer for bun)","Confirm with `pnpm --version` (or the relevant binary) that it is now on PATH","Re-run the setter so the warning disappears","If intentional, ignore the warning — the preference was saved and will apply once the tool is installed"],"exampleFix":"// before\n$ node scripts/setup-package-manager.js --set-global pnpm\nWarning: pnpm is not installed on your system\n// after\n$ npm i -g pnpm && pnpm --version\n$ node scripts/setup-package-manager.js --set-global pnpm\n✓ Global preference set to: pnpm","handlingStrategy":"validation","validationCode":"const pm = 'pnpm';\nif (!PACKAGE_MANAGERS[pm]) { console.error('unknown PM'); process.exit(1); }\ntry { execSync(`${pm} --version`, { stdio: 'ignore' }); } catch { console.warn(`${pm} not on PATH`); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the package manager before setting it as the global preference","Verify with `<pm> --version` that the binary resolves on PATH","On fresh machines/CI, bootstrap dependencies before configuring preferences"],"tags":["cli","package-manager","environment","setup"],"backgroundTag":"command-not-found","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}