Skip to content

Commit 56c1656

Browse files
committed
Clear verdaccio npm cache
1 parent 2091b73 commit 56c1656

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ const runGenerator = () => {
132132
console.log(`Clearing npx cache at ${pathToNpxCache}`)
133133
sh.rm('-rf', pathToNpxCache)
134134

135+
// Clean the npm cache to avoid ECOMPROMISED errors on Windows.
136+
// The earlier `npm ci` step populates the cache with integrity hashes from the
137+
// public npm registry. When Verdaccio serves locally-built packages with different
138+
// integrity hashes, npm (especially v11+) throws ECOMPROMISED on Windows.
139+
console.log('Cleaning npm cache to avoid integrity conflicts with local registry')
140+
sh.exec('npm cache clean --force', {silent: true})
141+
135142
console.log('Running the generator')
136143
cp.execSync(
137144
`npx ${flags} @salesforce/pwa-kit-create-app@latest ${process.argv.slice(2).join(' ')}`,

0 commit comments

Comments
 (0)