shama / napa

:wine_glass: A helper for installing stuff without a package.json with npm.
MIT License
412 stars 34 forks source link

npm prune removes napa packages #22

Open kud opened 9 years ago

kud commented 9 years ago

When you do npm prune, it removes packages installed by napa. It's a nonsense as it's defined in napa key in package.json.

It sounds logical though about npm but a fix should be done.

What do you think?

shama commented 9 years ago

I'm not sure how I could fix it as I can't make npm prune aware of my library. Any ideas?

kud commented 9 years ago

We could give a alias to the user to override prune or create another script with prune-with-napa.

shama commented 9 years ago

Hmm interesting. I wonder if we'd be opening pandora's box by beginning to wrap npm commands to be napa aware? napa prune? Or really napa xxxx just aliases down to the npm command and does special handling for the commands it needs to. Hmm...

kud commented 9 years ago

The thing is it's not a prune on napa, it's just to make npm aware there're napa packages.

shama commented 9 years ago

It looks like if you add the package to bundledDependencies it will not prune the package. For example:

"bundledDependencies": [
  "ember", "handlebars", "jquery"
]

So maybe when installing, napa should add the packages to that key to help with this flow?

ajbogh commented 5 years ago

The bundledDependencies solution didn't work for me, and, with this change, attempting to uninstall a package after npm had removed the extra folders caused npm to give the warning:

npm ERR! code E404
npm ERR! 404 Not Found: sphinxbase@*