fix: resolve npm install peer dependency issues
Comprehensive fix for installer failures related to Astro/Starlight peer dependencies: 1. Update @astrojs/starlight from 0.37.0 to 0.37.5 (latest stable) 2. Add .npmrc with legacy-peer-deps to prevent peer dependency warnings 3. Update module installer to use --legacy-peer-deps flag for external modules This resolves issues where: - npm shows peer dependency warnings that users interpret as failures - External module installations fail due to strict peer dependency checking - Different npm versions handle peer dependencies inconsistently Technical note: Starlight 0.37.x requires astro@^5.5.0, which is compatible with astro@5.16.0 (^5.5.0 means >=5.5.0 <6.0.0). The issue was npm's warning display, not actual incompatibility. Fixes: Installation errors reported in v6.0.0-Beta.2 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5fe54de24e
commit
6198add5bd
6
.npmrc
6
.npmrc
|
|
@ -1 +1,5 @@
|
||||||
registry=https://registry.npmjs.org
|
# Prevent peer dependency warnings during installation
|
||||||
|
legacy-peer-deps=true
|
||||||
|
|
||||||
|
# Improve install performance
|
||||||
|
prefer-offline=true
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -88,7 +88,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/sitemap": "^3.6.0",
|
"@astrojs/sitemap": "^3.6.0",
|
||||||
"@astrojs/starlight": "^0.37.0",
|
"@astrojs/starlight": "^0.37.5",
|
||||||
"@eslint/js": "^9.33.0",
|
"@eslint/js": "^9.33.0",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"astro": "^5.16.0",
|
"astro": "^5.16.0",
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,7 @@ class ModuleManager {
|
||||||
if (needsDependencyInstall || wasNewClone || nodeModulesMissing) {
|
if (needsDependencyInstall || wasNewClone || nodeModulesMissing) {
|
||||||
const installSpinner = ora(`Installing dependencies for ${moduleInfo.name}...`).start();
|
const installSpinner = ora(`Installing dependencies for ${moduleInfo.name}...`).start();
|
||||||
try {
|
try {
|
||||||
execSync('npm install --production --no-audit --no-fund --prefer-offline --no-progress', {
|
execSync('npm install --production --no-audit --no-fund --prefer-offline --no-progress --legacy-peer-deps', {
|
||||||
cwd: moduleCacheDir,
|
cwd: moduleCacheDir,
|
||||||
stdio: 'pipe',
|
stdio: 'pipe',
|
||||||
timeout: 120_000, // 2 minute timeout
|
timeout: 120_000, // 2 minute timeout
|
||||||
|
|
@ -441,7 +441,7 @@ class ModuleManager {
|
||||||
if (packageJsonNewer) {
|
if (packageJsonNewer) {
|
||||||
const installSpinner = ora(`Installing dependencies for ${moduleInfo.name}...`).start();
|
const installSpinner = ora(`Installing dependencies for ${moduleInfo.name}...`).start();
|
||||||
try {
|
try {
|
||||||
execSync('npm install --production --no-audit --no-fund --prefer-offline --no-progress', {
|
execSync('npm install --production --no-audit --no-fund --prefer-offline --no-progress --legacy-peer-deps', {
|
||||||
cwd: moduleCacheDir,
|
cwd: moduleCacheDir,
|
||||||
stdio: 'pipe',
|
stdio: 'pipe',
|
||||||
timeout: 120_000, // 2 minute timeout
|
timeout: 120_000, // 2 minute timeout
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue