ds300 / patch-package

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

I have a dependency installed from git, but patch-package tries to install it from NPM #352

Open trusktr opened 2 years ago

trusktr commented 2 years ago

For example, my package.json has this:

{
    "dependencies": {
        "ros3d": "trusktr/ros3djs#1abbdc840ac7c72ec39f695a5edc8284a06bf363",
    },
}

but when I run npx patch-package ros3d I see that it does not pull that same version of the dependency:

❯ npx patch-package ros3d
patch-package 6.4.7
• Creating temporary folder
• Installing ros3d@1.0.1 with npm <-------------------- HERE
• Diffing your files with clean files
Error: ENOENT: no such file or directory, scandir '/tmp/tmp-7683832GWujDmdU1h7/node_modules/ros3d'
    at Object.readdirSync (fs.js:1021:3)
...

It should copy "ros3d": "trusktr/ros3djs#1abbdc840ac7c72ec39f695a5edc8284a06bf363" over into the temporary directory's package.json, or it should be using a command like npm install ros3d@trusktr/ros3djs#1abbdc840ac7c72ec39f695a5edc8284a06bf363.