ds300 / patch-package

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

dereference symlink on copying .npmrc and .yarnrc in makePatch #402

Closed jimmyltsinn closed 1 year ago

jimmyltsinn commented 2 years ago

Our team was facing problem on making patch, in which the package is hosted in private registry. We have noticed that #152 has already handle such scenario, but we are still facing error with message similar as #300

After checking, we notice that since our .npmrc is symlink to somewhere else (as to facilitate switch registry), we use symlink which is copied into the tmp folder during make patch, and thus the symlink cannot resolve.

This PR uses node fs copySync dereference flag (https://github.com/jprichardson/node-fs-extra/blob/master/docs/copy-sync.md) to dereference the symlink

Thanks

orta commented 1 year ago

Thanks for the useful writeup, and links to the docs - this makes sense to me 👍🏻

ds300 commented 1 year ago

This was just released in v6.5.0! Thanks for your contribution 🙏🏼 🎉