ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.44k stars 295 forks source link

Can't patch package @strapi/admin #378

Closed davefv closed 2 years ago

davefv commented 2 years ago

Hi,

After patch file I execute:

npx patch-package @strapi/admin

With result:

patch-package 6.4.7
• Creating temporary folder
• Installing @strapi/admin@4.1.0 with npm
• Diffing your files with clean files
Error: ENOENT: no such file or directory, stat '/var/www/strapi/node_modules/@strapi/admin/node_modules/cross-spawn/node_modules/.bin/which'
    at Object.statSync (fs.js:1086:3)
    at Object.statSync (/var/www/strapi/node_modules/graceful-fs/polyfills.js:312:16)
    at checkStats (/var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:171:22)
    at checkPaths (/var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:183:31)
    at copyDirItem (/var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:117:20)
    at /var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:39
    at Array.forEach (<anonymous>)
    at copyDir (/var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:23)
    at mkDirAndCopy (/var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:106:3)
    at onDir (/var/www/strapi/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:97:37) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/var/www/strapi/node_modules/@strapi/admin/node_modules/cross-spawn/node_modules/.bin/which'
}

My environment:

OS: Ubuntu 20.04
Node: v14.15.1
npm: 8.5.1

Can you help me?

Thank you very much!

alexkrav commented 2 years ago

@davefv you've closed this issue, but could you please let us know what was the reason. I have the same problem as well

davefv commented 2 years ago

I don't remember the exact solution, but I think:

rm -rf build/
rm -rf node_modules
rm package-lock.json
npm i
npx patch-package @strapi/admin
npm run build

Hope this helps!