npm-bundle icon indicating copy to clipboard operation
npm-bundle copied to clipboard

Doesn't work with scoped modules

Open PMByrne opened this issue 9 years ago • 5 comments

Pretty easy to reproduce.

Simple install any scoped module and run your module.

The tgz file that is generated will not include the scoped module when the tarball is extracted.

PMByrne avatar Jan 08 '16 22:01 PMByrne

Thanks, I will look into this

majgis avatar Feb 26 '16 14:02 majgis

Looks like this is an npm issue: npm/npm#9175

I will investigate a stop-gap work around.

majgis avatar Feb 26 '16 16:02 majgis

A workaround seems like a very good idea. The npm issue appears to have stalled…

lizell avatar Dec 08 '16 15:12 lizell

To get this to work with a scoped module is just a matter of a simple fix on npm-bundle's index.js, on the glob.bind(null, '*') line.

the problem is simply that npm-bundle does not find the package.json directly as child of the first folder in .nmpbundle/node_modules.

In other words without scope you have:

.npmbundle/node_modules/your_package/package.json

With scopes you have:

.npmbundle/node_modules/@scope/your_package/package.json

so glob.bind(null, '*') returns @scope which does not have a package.json inside.

So a general fix should be easy to cook, glob.bind(null, '@*/*') is a simple workaround only for scoped cases.

lealgerardo avatar May 15 '17 16:05 lealgerardo

Any progress?

BlackGad avatar Jun 04 '19 07:06 BlackGad